| 1 | '============================================================================================ | = | 1 | '============================================================================================ |
| 2 | ' ? Copyright, 2005-2008 MicroFour, Inc., All rights reserved. | 2 | ' ? Copyright, 2005-2008 MicroFour, Inc., All rights reserved. | |
| 3 | ' | 3 | ' | |
| 4 | ' This software and its associated documentation contain valuable trade secrets | 4 | ' This software and its associated documentation contain valuable trade secrets | |
| 5 | ' and proprietary information belonging to MicroFour, Inc. None of the software | 5 | ' and proprietary information belonging to MicroFour, Inc. None of the software | |
| 6 | ' or its associated documentation may be stored in a retrieval system, copied, | 6 | ' or its associated documentation may be stored in a retrieval system, copied, | |
| 7 | ' transmitted, distributed, transcribed or reproduced in any other way or disclosed | 7 | ' transmitted, distributed, transcribed or reproduced in any other way or disclosed | |
| 8 | ' to any third parties without the express written permission of MicroFour, Inc. | 8 | ' to any third parties without the express written permission of MicroFour, Inc. | |
| 9 | ' | 9 | ' | |
| 10 | ' UNDER NO CIRCUMSTANCES SHALL MICROFOUR, INC. BE LIABLE FOR INCIDENTAL, SPECIAL, | 10 | ' UNDER NO CIRCUMSTANCES SHALL MICROFOUR, INC. BE LIABLE FOR INCIDENTAL, SPECIAL, | |
| 11 | ' INDIRECT, DIRECT OR CONSEQUENTIAL DAMAGES OR LOSS OF PROFITS, INTERRUPTION OF | 11 | ' INDIRECT, DIRECT OR CONSEQUENTIAL DAMAGES OR LOSS OF PROFITS, INTERRUPTION OF | |
| 12 | ' BUSINESS, OR RELATED EXPENSES WHICH MAY ARISE FROM THE USE OF SOFTWARE OR DOCUMENTATION, | 12 | ' BUSINESS, OR RELATED EXPENSES WHICH MAY ARISE FROM THE USE OF SOFTWARE OR DOCUMENTATION, | |
| 13 | ' INCLUDING BUT NOT LIMITED TO THOSE RESULTING FROM DEFECTS IN SOFTWARE AND/OR DOCUMENTATION, | 13 | ' INCLUDING BUT NOT LIMITED TO THOSE RESULTING FROM DEFECTS IN SOFTWARE AND/OR DOCUMENTATION, | |
| 14 | ' OR LOSS OR INACCURACY OF DATA OF ANY KIND. | 14 | ' OR LOSS OR INACCURACY OF DATA OF ANY KIND. | |
| 15 | '-------------------------------------------------------------------------------------------- | 15 | '-------------------------------------------------------------------------------------------- | |
| 16 | ' ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS OF THE COPYRIGHT NOTICE | 16 | ' ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS OF THE COPYRIGHT NOTICE | |
| 17 | '-------------------------------------------------------------------------------------------- | 17 | '-------------------------------------------------------------------------------------------- | |
| 18 | ' DO NOT REMOVE THIS DISCLAIMER | 18 | ' DO NOT REMOVE THIS DISCLAIMER | |
| 19 | '============================================================================================ | 19 | '============================================================================================ | |
| 20 | 20 | |||
| 21 | Option Strict On | 21 | Option Strict On | |
| 22 | 22 | |||
| 23 | Imports MicroFour.StrataFrame.Extensibility | 23 | Imports MicroFour.StrataFrame.Extensibility | |
| 24 | Imports MicroFour.StrataFrame.Business | 24 | Imports MicroFour.StrataFrame.Business | |
| 25 | Imports MicroFour.StrataFrame.Data | 25 | Imports MicroFour.StrataFrame.Data | |
| 26 | Imports MicroFour.StrataFrame.Messaging | 26 | Imports MicroFour.StrataFrame.Messaging | |
| 27 | Imports MicroFour.StrataFrame.Security | 27 | Imports MicroFour.StrataFrame.Security | |
| 28 | Imports MicroFour.StrataFrame.Win32 | 28 | Imports MicroFour.StrataFrame.Win32 | |
| 29 | Imports Microsoft.Win32 | 29 | Imports Microsoft.Win32 | |
| 30 | Imports System.Collections.Generic | 30 | Imports System.Collections.Generic | |
| 31 | Imports System.ComponentModel | 31 | Imports System.ComponentModel | |
| 32 | Imports System.Diagnostics | 32 | Imports System.Diagnostics | |
| 33 | Imports System.Drawing.Design | 33 | Imports System.Drawing.Design | |
| 34 | Imports System.Drawing | 34 | Imports System.Drawing | |
| 35 | Imports System.Windows.Forms | 35 | Imports System.Windows.Forms | |
| 36 | 36 | |||
| 37 | Namespace UI.Windows.Forms | 37 | Namespace UI.Windows.Forms | |
| 38 | 38 | |||
| 39 | Public Class BaseForm | <> | 39 | Public Class BaseForm_wDXRibbon |
| 40 | Inherits System.Windows.Forms.Form | 40 | Inherits DevExpress.XtraBars.Ribbon.RibbonForm | |
| 41 | Implements MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl | = | 41 | Implements MicroFour.StrataFrame.UI.Windows.Forms.IContainerControl |
| 42 | 42 | |||
| 43 | #Region " Events " | 43 | #Region " Events " | |
| 44 | 44 | |||
| 45 | #Region " Declare Events " | 45 | #Region " Declare Events " | |
| 46 | 46 | |||
| 47 | Public Event BeforeSave(ByVal e As BeforeSaveUndoByFormEventArgs) | 47 | Public Event BeforeSave(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 48 | Public Event AfterSave(ByVal e As AfterSaveUndoByFormEventArgs) | 48 | Public Event AfterSave(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 49 | Public Event BeforeUndo(ByVal e As BeforeSaveUndoByFormEventArgs) | 49 | Public Event BeforeUndo(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 50 | Public Event AfterUndo(ByVal e As AfterSaveUndoByFormEventArgs) | 50 | Public Event AfterUndo(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 51 | Public Event BusinessRulesChecked(ByVal e As BusinessRulesCheckedEventArgs) | 51 | Public Event BusinessRulesChecked(ByVal e As BusinessRulesCheckedEventArgs) | |
| 52 | Public Event BeforeDelete(ByVal e As BeforeDeleteEventArgs) | 52 | Public Event BeforeDelete(ByVal e As BeforeDeleteEventArgs) | |
| 53 | Public Event UnsavedChangesExist(ByVal e As UnsavedChangesExistEventArgs) | 53 | Public Event UnsavedChangesExist(ByVal e As UnsavedChangesExistEventArgs) | |
| 54 | Public Event AfterDelete(ByVal e As AfterDeleteEventArgs) | 54 | Public Event AfterDelete(ByVal e As AfterDeleteEventArgs) | |
| 55 | Public Event ErrorSaving(ByVal e As ErrorSavingByFormEventArgs) | 55 | Public Event ErrorSaving(ByVal e As ErrorSavingByFormEventArgs) | |
| 56 | 56 | |||
| 57 | 57 | |||
| 58 | Public Delegate Sub FormEditingStateChangedEventHandler(ByVal e As EditingStateChangedEventArgs) | 58 | Public Delegate Sub FormEditingStateChangedEventHandler(ByVal e As EditingStateChangedEventArgs) | |
| 59 | Private _Handler_FormEditingStateChanged As FormEditingStateChangedEventHandler | 59 | Private _Handler_FormEditingStateChanged As FormEditingStateChangedEventHandler | |
| 60 | ''' <summary> | 60 | ''' <summary> | |
| 61 | ''' Occurs when the last business object during an Add, Edit, Save, or Delete, or Undo has changed | 61 | ''' Occurs when the last business object during an Add, Edit, Save, or Delete, or Undo has changed | |
| 62 | ''' it's state. | 62 | ''' it's state. | |
| 63 | ''' </summary> | 63 | ''' </summary> | |
| 64 | ''' <remarks></remarks> | 64 | ''' <remarks></remarks> | |
| 65 | Public Custom Event FormEditingStateChanged As FormEditingStateChangedEventHandler | 65 | Public Custom Event FormEditingStateChanged As FormEditingStateChangedEventHandler | |
| 66 | AddHandler(ByVal value As FormEditingStateChangedEventHandler) | 66 | AddHandler(ByVal value As FormEditingStateChangedEventHandler) | |
| 67 | Me._Handler_FormEditingStateChanged = CType([Delegate].Combine(Me._Handler_FormEditingStateChanged, value), FormEditingStateChangedEventHandler) | 67 | Me._Handler_FormEditingStateChanged = CType([Delegate].Combine(Me._Handler_FormEditingStateChanged, value), FormEditingStateChangedEventHandler) | |
| 68 | End AddHandler | 68 | End AddHandler | |
| 69 | RemoveHandler(ByVal value As FormEditingStateChangedEventHandler) | 69 | RemoveHandler(ByVal value As FormEditingStateChangedEventHandler) | |
| 70 | Me._Handler_FormEditingStateChanged = CType([Delegate].Remove(Me._Handler_FormEditingStateChanged, value), FormEditingStateChangedEventHandler) | 70 | Me._Handler_FormEditingStateChanged = CType([Delegate].Remove(Me._Handler_FormEditingStateChanged, value), FormEditingStateChangedEventHandler) | |
| 71 | End RemoveHandler | 71 | End RemoveHandler | |
| 72 | RaiseEvent(ByVal e As EditingStateChangedEventArgs) | 72 | RaiseEvent(ByVal e As EditingStateChangedEventArgs) | |
| 73 | If Me._Handler_FormEditingStateChanged IsNot Nothing Then | 73 | If Me._Handler_FormEditingStateChanged IsNot Nothing Then | |
| 74 | If Me.InvokeRequired Then | 74 | If Me.InvokeRequired Then | |
| 75 | Me.Invoke(Me._Handler_FormEditingStateChanged, e) | 75 | Me.Invoke(Me._Handler_FormEditingStateChanged, e) | |
| 76 | Else | 76 | Else | |
| 77 | Me._Handler_FormEditingStateChanged.Invoke(e) | 77 | Me._Handler_FormEditingStateChanged.Invoke(e) | |
| 78 | End If | 78 | End If | |
| 79 | End If | 79 | End If | |
| 80 | End RaiseEvent | 80 | End RaiseEvent | |
| 81 | End Event | 81 | End Event | |
| 82 | 82 | |||
| 83 | Public Delegate Sub FormNavigatedEventHandler(ByVal e As NavigatedEventArgs) | 83 | Public Delegate Sub FormNavigatedEventHandler(ByVal e As NavigatedEventArgs) | |
| 84 | Private _Handler_FormNavigated As FormNavigatedEventHandler | 84 | Private _Handler_FormNavigated As FormNavigatedEventHandler | |
| 85 | ''' <summary> | 85 | ''' <summary> | |
| 86 | ''' Occurs when the last business object has navigated as a result of the Navigate() | 86 | ''' Occurs when the last business object has navigated as a result of the Navigate() | |
| 87 | ''' </summary> | 87 | ''' </summary> | |
| 88 | ''' <remarks></remarks> | 88 | ''' <remarks></remarks> | |
| 89 | Public Custom Event FormNavigated As FormNavigatedEventHandler | 89 | Public Custom Event FormNavigated As FormNavigatedEventHandler | |
| 90 | AddHandler(ByVal value As FormNavigatedEventHandler) | 90 | AddHandler(ByVal value As FormNavigatedEventHandler) | |
| 91 | Me._Handler_FormNavigated = CType([Delegate].Combine(Me._Handler_FormNavigated, value), FormNavigatedEventHandler) | 91 | Me._Handler_FormNavigated = CType([Delegate].Combine(Me._Handler_FormNavigated, value), FormNavigatedEventHandler) | |
| 92 | End AddHandler | 92 | End AddHandler | |
| 93 | RemoveHandler(ByVal value As FormNavigatedEventHandler) | 93 | RemoveHandler(ByVal value As FormNavigatedEventHandler) | |
| 94 | Me._Handler_FormNavigated = CType([Delegate].Remove(Me._Handler_FormNavigated, value), FormNavigatedEventHandler) | 94 | Me._Handler_FormNavigated = CType([Delegate].Remove(Me._Handler_FormNavigated, value), FormNavigatedEventHandler) | |
| 95 | End RemoveHandler | 95 | End RemoveHandler | |
| 96 | RaiseEvent(ByVal e As NavigatedEventArgs) | 96 | RaiseEvent(ByVal e As NavigatedEventArgs) | |
| 97 | If Me._Handler_FormNavigated IsNot Nothing Then | 97 | If Me._Handler_FormNavigated IsNot Nothing Then | |
| 98 | If Me.InvokeRequired Then | 98 | If Me.InvokeRequired Then | |
| 99 | Me.Invoke(Me._Handler_FormNavigated, e) | 99 | Me.Invoke(Me._Handler_FormNavigated, e) | |
| 100 | Else | 100 | Else | |
| 101 | Me._Handler_FormNavigated.Invoke(e) | 101 | Me._Handler_FormNavigated.Invoke(e) | |
| 102 | End If | 102 | End If | |
| 103 | End If | 103 | End If | |
| 104 | End RaiseEvent | 104 | End RaiseEvent | |
| 105 | End Event | 105 | End Event | |
| 106 | 106 | |||
| 107 | Public Delegate Sub ConcurrencyExceptionEventHandler(ByVal e As ConcurrencyExceptionEventArgs) | 107 | Public Delegate Sub ConcurrencyExceptionEventHandler(ByVal e As ConcurrencyExceptionEventArgs) | |
| 108 | Private _Handler_ConcurrencyException As ConcurrencyExceptionEventHandler | 108 | Private _Handler_ConcurrencyException As ConcurrencyExceptionEventHandler | |
| 109 | ''' <summary> | 109 | ''' <summary> | |
| 110 | ''' Occurs whenever a business object on the form encounters a concurrency exception and is | 110 | ''' Occurs whenever a business object on the form encounters a concurrency exception and is | |
| 111 | ''' configured to raise an event upon that concurrency exception. | 111 | ''' configured to raise an event upon that concurrency exception. | |
| 112 | ''' </summary> | 112 | ''' </summary> | |
| 113 | ''' <remarks></remarks> | 113 | ''' <remarks></remarks> | |
| 114 | Public Custom Event ConcurrencyException As ConcurrencyExceptionEventHandler | 114 | Public Custom Event ConcurrencyException As ConcurrencyExceptionEventHandler | |
| 115 | AddHandler(ByVal value As ConcurrencyExceptionEventHandler) | 115 | AddHandler(ByVal value As ConcurrencyExceptionEventHandler) | |
| 116 | Me._Handler_ConcurrencyException = CType([Delegate].Combine(Me._Handler_ConcurrencyException, value), ConcurrencyExceptionEventHandler) | 116 | Me._Handler_ConcurrencyException = CType([Delegate].Combine(Me._Handler_ConcurrencyException, value), ConcurrencyExceptionEventHandler) | |
| 117 | End AddHandler | 117 | End AddHandler | |
| 118 | RemoveHandler(ByVal value As ConcurrencyExceptionEventHandler) | 118 | RemoveHandler(ByVal value As ConcurrencyExceptionEventHandler) | |
| 119 | Me._Handler_ConcurrencyException = CType([Delegate].Remove(Me._Handler_ConcurrencyException, value), ConcurrencyExceptionEventHandler) | 119 | Me._Handler_ConcurrencyException = CType([Delegate].Remove(Me._Handler_ConcurrencyException, value), ConcurrencyExceptionEventHandler) | |
| 120 | End RemoveHandler | 120 | End RemoveHandler | |
| 121 | RaiseEvent(ByVal e As Data.ConcurrencyExceptionEventArgs) | 121 | RaiseEvent(ByVal e As Data.ConcurrencyExceptionEventArgs) | |
| 122 | If Me._Handler_ConcurrencyException IsNot Nothing Then | 122 | If Me._Handler_ConcurrencyException IsNot Nothing Then | |
| 123 | Me._Handler_ConcurrencyException.Invoke(e) | 123 | Me._Handler_ConcurrencyException.Invoke(e) | |
| 124 | End If | 124 | End If | |
| 125 | End RaiseEvent | 125 | End RaiseEvent | |
| 126 | End Event | 126 | End Event | |
| 127 | 127 | |||
| 128 | #End Region | 128 | #End Region | |
| 129 | 129 | |||
| 130 | #Region " Declare Delegates " | 130 | #Region " Declare Delegates " | |
| 131 | 131 | |||
| 132 | Private Delegate Sub BeforeSave_Delegate(ByVal e As BeforeSaveUndoByFormEventArgs) | 132 | Private Delegate Sub BeforeSave_Delegate(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 133 | Private Delegate Sub AfterSave_Delegate(ByVal e As AfterSaveUndoByFormEventArgs) | 133 | Private Delegate Sub AfterSave_Delegate(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 134 | Private Delegate Sub BeforeUndo_Delegate(ByVal e As BeforeSaveUndoByFormEventArgs) | 134 | Private Delegate Sub BeforeUndo_Delegate(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 135 | Private Delegate Sub AfterUndo_Delegate(ByVal e As AfterSaveUndoByFormEventArgs) | 135 | Private Delegate Sub AfterUndo_Delegate(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 136 | Private Delegate Sub BusinessRulesChecked_Delegate(ByVal e As BusinessRulesCheckedEventArgs) | 136 | Private Delegate Sub BusinessRulesChecked_Delegate(ByVal e As BusinessRulesCheckedEventArgs) | |
| 137 | Private Delegate Sub BeforeDelete_Delegate(ByVal e As BeforeDeleteEventArgs) | 137 | Private Delegate Sub BeforeDelete_Delegate(ByVal e As BeforeDeleteEventArgs) | |
| 138 | Private Delegate Sub UnsavedChangesExist_Delegate(ByVal e As UnsavedChangesExistEventArgs) | 138 | Private Delegate Sub UnsavedChangesExist_Delegate(ByVal e As UnsavedChangesExistEventArgs) | |
| 139 | Private Delegate Sub AfterDelete_Delegate(ByVal e As AfterDeleteEventArgs) | 139 | Private Delegate Sub AfterDelete_Delegate(ByVal e As AfterDeleteEventArgs) | |
| 140 | Private Delegate Sub ErrorSaving_Delegate(ByVal e As ErrorSavingByFormEventArgs) | 140 | Private Delegate Sub ErrorSaving_Delegate(ByVal e As ErrorSavingByFormEventArgs) | |
| 141 | 141 | |||
| 142 | #End Region | 142 | #End Region | |
| 143 | 143 | |||
| 144 | #Region " Invoke Functions " | 144 | #Region " Invoke Functions " | |
| 145 | 145 | |||
| 146 | ''' <summary> | 146 | ''' <summary> | |
| 147 | ''' Raises the ErrorSaving event | 147 | ''' Raises the ErrorSaving event | |
| 148 | ''' </summary> | 148 | ''' </summary> | |
| 149 | ''' <param name="e"></param> | 149 | ''' <param name="e"></param> | |
| 150 | ''' <remarks></remarks> | 150 | ''' <remarks></remarks> | |
| 151 | Private Sub InvokeErrorSaving(ByVal e As ErrorSavingByFormEventArgs) | 151 | Private Sub InvokeErrorSaving(ByVal e As ErrorSavingByFormEventArgs) | |
| 152 | RaiseEvent ErrorSaving(e) | 152 | RaiseEvent ErrorSaving(e) | |
| 153 | End Sub | 153 | End Sub | |
| 154 | 154 | |||
| 155 | ''' <summary> | 155 | ''' <summary> | |
| 156 | ''' Raises the After Delete | 156 | ''' Raises the After Delete | |
| 157 | ''' </summary> | 157 | ''' </summary> | |
| 158 | ''' <param name="e"></param> | 158 | ''' <param name="e"></param> | |
| 159 | ''' <remarks></remarks> | 159 | ''' <remarks></remarks> | |
| 160 | Private Sub InvokeAfterDelete(ByVal e As AfterDeleteEventArgs) | 160 | Private Sub InvokeAfterDelete(ByVal e As AfterDeleteEventArgs) | |
| 161 | RaiseEvent AfterDelete(e) | 161 | RaiseEvent AfterDelete(e) | |
| 162 | End Sub | 162 | End Sub | |
| 163 | 163 | |||
| 164 | ''' <summary> | 164 | ''' <summary> | |
| 165 | ''' Raises the Before Delete | 165 | ''' Raises the Before Delete | |
| 166 | ''' </summary> | 166 | ''' </summary> | |
| 167 | ''' <param name="e"></param> | 167 | ''' <param name="e"></param> | |
| 168 | ''' <remarks></remarks> | 168 | ''' <remarks></remarks> | |
| 169 | Private Sub InvokeBeforeDelete(ByVal e As BeforeDeleteEventArgs) | 169 | Private Sub InvokeBeforeDelete(ByVal e As BeforeDeleteEventArgs) | |
| 170 | RaiseEvent BeforeDelete(e) | 170 | RaiseEvent BeforeDelete(e) | |
| 171 | End Sub | 171 | End Sub | |
| 172 | 172 | |||
| 173 | ''' <summary> | 173 | ''' <summary> | |
| 174 | ''' Raises the Before Save Event | 174 | ''' Raises the Before Save Event | |
| 175 | ''' </summary> | 175 | ''' </summary> | |
| 176 | ''' <param name="e"></param> | 176 | ''' <param name="e"></param> | |
| 177 | ''' <remarks></remarks> | 177 | ''' <remarks></remarks> | |
| 178 | Private Sub InvokeBeforeSave(ByVal e As BeforeSaveUndoByFormEventArgs) | 178 | Private Sub InvokeBeforeSave(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 179 | RaiseEvent BeforeSave(e) | 179 | RaiseEvent BeforeSave(e) | |
| 180 | End Sub | 180 | End Sub | |
| 181 | 181 | |||
| 182 | ''' <summary> | 182 | ''' <summary> | |
| 183 | ''' Raises the After Save Event | 183 | ''' Raises the After Save Event | |
| 184 | ''' </summary> | 184 | ''' </summary> | |
| 185 | ''' <param name="e"></param> | 185 | ''' <param name="e"></param> | |
| 186 | ''' <remarks></remarks> | 186 | ''' <remarks></remarks> | |
| 187 | Private Sub InvokeAfterSave(ByVal e As AfterSaveUndoByFormEventArgs) | 187 | Private Sub InvokeAfterSave(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 188 | RaiseEvent AfterSave(e) | 188 | RaiseEvent AfterSave(e) | |
| 189 | End Sub | 189 | End Sub | |
| 190 | 190 | |||
| 191 | ''' <summary> | 191 | ''' <summary> | |
| 192 | ''' Raises the Before Save Event | 192 | ''' Raises the Before Save Event | |
| 193 | ''' </summary> | 193 | ''' </summary> | |
| 194 | ''' <param name="e"></param> | 194 | ''' <param name="e"></param> | |
| 195 | ''' <remarks></remarks> | 195 | ''' <remarks></remarks> | |
| 196 | Private Sub InvokeBeforeUndo(ByVal e As BeforeSaveUndoByFormEventArgs) | 196 | Private Sub InvokeBeforeUndo(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 197 | RaiseEvent BeforeUndo(e) | 197 | RaiseEvent BeforeUndo(e) | |
| 198 | End Sub | 198 | End Sub | |
| 199 | 199 | |||
| 200 | ''' <summary> | 200 | ''' <summary> | |
| 201 | ''' Raises the After Save Event | 201 | ''' Raises the After Save Event | |
| 202 | ''' </summary> | 202 | ''' </summary> | |
| 203 | ''' <param name="e"></param> | 203 | ''' <param name="e"></param> | |
| 204 | ''' <remarks></remarks> | 204 | ''' <remarks></remarks> | |
| 205 | Private Sub InvokeAfterUndo(ByVal e As AfterSaveUndoByFormEventArgs) | 205 | Private Sub InvokeAfterUndo(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 206 | RaiseEvent AfterUndo(e) | 206 | RaiseEvent AfterUndo(e) | |
| 207 | End Sub | 207 | End Sub | |
| 208 | 208 | |||
| 209 | '''' <summary> | 209 | '''' <summary> | |
| 210 | '''' Raises the EditingStateChanged event | 210 | '''' Raises the EditingStateChanged event | |
| 211 | '''' </summary> | 211 | '''' </summary> | |
| 212 | '''' <param name="ChangedBusinessObject"></param> | 212 | '''' <param name="ChangedBusinessObject"></param> | |
| 213 | '''' <param name="State"></param> | 213 | '''' <param name="State"></param> | |
| 214 | '''' <remarks></remarks> | 214 | '''' <remarks></remarks> | |
| 215 | 'Private Sub InvokeEditingStateChanged(ByVal ChangedBusinessObject As BusinessLayer, ByVal State As BusinessEditingState) | 215 | 'Private Sub InvokeEditingStateChanged(ByVal ChangedBusinessObject As BusinessLayer, ByVal State As BusinessEditingState) | |
| 216 | ' RaiseEvent EditingStateChanged(ChangedBusinessObject, State) | 216 | ' RaiseEvent EditingStateChanged(ChangedBusinessObject, State) | |
| 217 | 'End Sub | 217 | 'End Sub | |
| 218 | 218 | |||
| 219 | ''' <summary> | 219 | ''' <summary> | |
| 220 | ''' Raises the EditingStateChanged event | 220 | ''' Raises the EditingStateChanged event | |
| 221 | ''' </summary> | 221 | ''' </summary> | |
| 222 | ''' <remarks></remarks> | 222 | ''' <remarks></remarks> | |
| 223 | Private Sub InvokeBusinessRulesChecked(ByVal e As BusinessRulesCheckedEventArgs) | 223 | Private Sub InvokeBusinessRulesChecked(ByVal e As BusinessRulesCheckedEventArgs) | |
| 224 | RaiseEvent BusinessRulesChecked(e) | 224 | RaiseEvent BusinessRulesChecked(e) | |
| 225 | End Sub | 225 | End Sub | |
| 226 | 226 | |||
| 227 | ''' <summary> | 227 | ''' <summary> | |
| 228 | ''' Raises the EditingStateChanged event | 228 | ''' Raises the EditingStateChanged event | |
| 229 | ''' </summary> | 229 | ''' </summary> | |
| 230 | ''' <remarks></remarks> | 230 | ''' <remarks></remarks> | |
| 231 | Private Sub InvokeUnsavedChangesExist(ByVal e As UnsavedChangesExistEventArgs) | 231 | Private Sub InvokeUnsavedChangesExist(ByVal e As UnsavedChangesExistEventArgs) | |
| 232 | RaiseEvent UnsavedChangesExist(e) | 232 | RaiseEvent UnsavedChangesExist(e) | |
| 233 | End Sub | 233 | End Sub | |
| 234 | 234 | |||
| 235 | #End Region | 235 | #End Region | |
| 236 | 236 | |||
| 237 | #Region " Synchronization Functions " | 237 | #Region " Synchronization Functions " | |
| 238 | 238 | |||
| 239 | ''' <summary> | 239 | ''' <summary> | |
| 240 | ''' Raises the After Delete event via a thread safe means. | 240 | ''' Raises the After Delete event via a thread safe means. | |
| 241 | ''' </summary> | 241 | ''' </summary> | |
| 242 | ''' <param name="e"></param> | 242 | ''' <param name="e"></param> | |
| 243 | ''' <remarks></remarks> | 243 | ''' <remarks></remarks> | |
| 244 | Private Sub RaiseErrorSavingEvent(ByVal e As ErrorSavingByFormEventArgs) | 244 | Private Sub RaiseErrorSavingEvent(ByVal e As ErrorSavingByFormEventArgs) | |
| 245 | If InvokeRequired Then | 245 | If InvokeRequired Then | |
| 246 | Invoke(New ErrorSaving_Delegate(AddressOf InvokeErrorSaving), New Object() {e}) | 246 | Invoke(New ErrorSaving_Delegate(AddressOf InvokeErrorSaving), New Object() {e}) | |
| 247 | Else | 247 | Else | |
| 248 | InvokeErrorSaving(e) | 248 | InvokeErrorSaving(e) | |
| 249 | End If | 249 | End If | |
| 250 | End Sub | 250 | End Sub | |
| 251 | 251 | |||
| 252 | ''' <summary> | 252 | ''' <summary> | |
| 253 | ''' Raises the After Delete event via a thread safe means. | 253 | ''' Raises the After Delete event via a thread safe means. | |
| 254 | ''' </summary> | 254 | ''' </summary> | |
| 255 | ''' <param name="e"></param> | 255 | ''' <param name="e"></param> | |
| 256 | ''' <remarks></remarks> | 256 | ''' <remarks></remarks> | |
| 257 | Private Sub RaiseAfterDeleteEvent(ByVal e As AfterDeleteEventArgs) | 257 | Private Sub RaiseAfterDeleteEvent(ByVal e As AfterDeleteEventArgs) | |
| 258 | If InvokeRequired Then | 258 | If InvokeRequired Then | |
| 259 | Invoke(New AfterDelete_Delegate(AddressOf InvokeAfterDelete), New Object() {e}) | 259 | Invoke(New AfterDelete_Delegate(AddressOf InvokeAfterDelete), New Object() {e}) | |
| 260 | Else | 260 | Else | |
| 261 | InvokeAfterDelete(e) | 261 | InvokeAfterDelete(e) | |
| 262 | End If | 262 | End If | |
| 263 | End Sub | 263 | End Sub | |
| 264 | 264 | |||
| 265 | ''' <summary> | 265 | ''' <summary> | |
| 266 | ''' Raises the Before Delete event via a thread safe means. | 266 | ''' Raises the Before Delete event via a thread safe means. | |
| 267 | ''' </summary> | 267 | ''' </summary> | |
| 268 | ''' <param name="e"></param> | 268 | ''' <param name="e"></param> | |
| 269 | ''' <remarks></remarks> | 269 | ''' <remarks></remarks> | |
| 270 | Private Sub RaiseBeforeDeleteEvent(ByVal e As BeforeDeleteEventArgs) | 270 | Private Sub RaiseBeforeDeleteEvent(ByVal e As BeforeDeleteEventArgs) | |
| 271 | If InvokeRequired Then | 271 | If InvokeRequired Then | |
| 272 | Invoke(New BeforeDelete_Delegate(AddressOf InvokeBeforeDelete), New Object() {e}) | 272 | Invoke(New BeforeDelete_Delegate(AddressOf InvokeBeforeDelete), New Object() {e}) | |
| 273 | Else | 273 | Else | |
| 274 | InvokeBeforeDelete(e) | 274 | InvokeBeforeDelete(e) | |
| 275 | End If | 275 | End If | |
| 276 | End Sub | 276 | End Sub | |
| 277 | 277 | |||
| 278 | ''' <summary> | 278 | ''' <summary> | |
| 279 | ''' Raises the Before Save event via Thread Safe means. | 279 | ''' Raises the Before Save event via Thread Safe means. | |
| 280 | ''' </summary> | 280 | ''' </summary> | |
| 281 | ''' <param name="e"></param> | 281 | ''' <param name="e"></param> | |
| 282 | ''' <remarks></remarks> | 282 | ''' <remarks></remarks> | |
| 283 | Private Sub RaiseBeforeSaveEvent(ByVal e As BeforeSaveUndoByFormEventArgs) | 283 | Private Sub RaiseBeforeSaveEvent(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 284 | If InvokeRequired Then | 284 | If InvokeRequired Then | |
| 285 | Invoke(New BeforeSave_Delegate(AddressOf InvokeBeforeSave), New Object() {e}) | 285 | Invoke(New BeforeSave_Delegate(AddressOf InvokeBeforeSave), New Object() {e}) | |
| 286 | Else | 286 | Else | |
| 287 | InvokeBeforeSave(e) | 287 | InvokeBeforeSave(e) | |
| 288 | End If | 288 | End If | |
| 289 | End Sub | 289 | End Sub | |
| 290 | 290 | |||
| 291 | ''' <summary> | 291 | ''' <summary> | |
| 292 | ''' Raises the After Save event via Thread Safe means. | 292 | ''' Raises the After Save event via Thread Safe means. | |
| 293 | ''' </summary> | 293 | ''' </summary> | |
| 294 | ''' <param name="e"></param> | 294 | ''' <param name="e"></param> | |
| 295 | ''' <remarks></remarks> | 295 | ''' <remarks></remarks> | |
| 296 | Private Sub RaiseAfterSaveEvent(ByVal e As AfterSaveUndoByFormEventArgs) | 296 | Private Sub RaiseAfterSaveEvent(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 297 | If InvokeRequired Then | 297 | If InvokeRequired Then | |
| 298 | Invoke(New AfterSave_Delegate(AddressOf InvokeAfterSave), New Object() {e}) | 298 | Invoke(New AfterSave_Delegate(AddressOf InvokeAfterSave), New Object() {e}) | |
| 299 | Else | 299 | Else | |
| 300 | InvokeAfterSave(e) | 300 | InvokeAfterSave(e) | |
| 301 | End If | 301 | End If | |
| 302 | End Sub | 302 | End Sub | |
| 303 | 303 | |||
| 304 | ''' <summary> | 304 | ''' <summary> | |
| 305 | ''' Raises the Before Save event via Thread Safe means. | 305 | ''' Raises the Before Save event via Thread Safe means. | |
| 306 | ''' </summary> | 306 | ''' </summary> | |
| 307 | ''' <param name="e"></param> | 307 | ''' <param name="e"></param> | |
| 308 | ''' <remarks></remarks> | 308 | ''' <remarks></remarks> | |
| 309 | Private Sub RaiseBeforeUndoEvent(ByVal e As BeforeSaveUndoByFormEventArgs) | 309 | Private Sub RaiseBeforeUndoEvent(ByVal e As BeforeSaveUndoByFormEventArgs) | |
| 310 | If InvokeRequired Then | 310 | If InvokeRequired Then | |
| 311 | Invoke(New BeforeUndo_Delegate(AddressOf InvokeBeforeUndo), New Object() {e}) | 311 | Invoke(New BeforeUndo_Delegate(AddressOf InvokeBeforeUndo), New Object() {e}) | |
| 312 | Else | 312 | Else | |
| 313 | InvokeBeforeUndo(e) | 313 | InvokeBeforeUndo(e) | |
| 314 | End If | 314 | End If | |
| 315 | End Sub | 315 | End Sub | |
| 316 | 316 | |||
| 317 | ''' <summary> | 317 | ''' <summary> | |
| 318 | ''' Raises the After Save event via Thread Safe means. | 318 | ''' Raises the After Save event via Thread Safe means. | |
| 319 | ''' </summary> | 319 | ''' </summary> | |
| 320 | ''' <param name="e"></param> | 320 | ''' <param name="e"></param> | |
| 321 | ''' <remarks></remarks> | 321 | ''' <remarks></remarks> | |
| 322 | Private Sub RaiseAfterUndoEvent(ByVal e As AfterSaveUndoByFormEventArgs) | 322 | Private Sub RaiseAfterUndoEvent(ByVal e As AfterSaveUndoByFormEventArgs) | |
| 323 | If InvokeRequired Then | 323 | If InvokeRequired Then | |
| 324 | Invoke(New AfterUndo_Delegate(AddressOf InvokeAfterUndo), New Object() {e}) | 324 | Invoke(New AfterUndo_Delegate(AddressOf InvokeAfterUndo), New Object() {e}) | |
| 325 | Else | 325 | Else | |
| 326 | InvokeAfterUndo(e) | 326 | InvokeAfterUndo(e) | |
| 327 | End If | 327 | End If | |
| 328 | End Sub | 328 | End Sub | |
| 329 | 329 | |||
| 330 | '''' <summary> | 330 | '''' <summary> | |
| 331 | '''' Raises the EditingStateChanged event via Thread Save means. | 331 | '''' Raises the EditingStateChanged event via Thread Save means. | |
| 332 | '''' </summary> | 332 | '''' </summary> | |
| 333 | '''' <param name="ChangedBusinessObject"></param> | 333 | '''' <param name="ChangedBusinessObject"></param> | |
| 334 | '''' <param name="State"></param> | 334 | '''' <param name="State"></param> | |
| 335 | '''' <remarks></remarks> | 335 | '''' <remarks></remarks> | |
| 336 | 'Private Sub RaiseEditingStateChangedEvent(ByVal ChangedBusinessObject As BusinessLayer, ByVal State As BusinessEditingState) | 336 | 'Private Sub RaiseEditingStateChangedEvent(ByVal ChangedBusinessObject As BusinessLayer, ByVal State As BusinessEditingState) | |
| 337 | ' If InvokeRequired Then | 337 | ' If InvokeRequired Then | |
| 338 | ' Invoke(New EditingStateChanged_Delegate(AddressOf InvokeEditingStateChanged), New Object() {ChangedBusinessObject, State}) | 338 | ' Invoke(New EditingStateChanged_Delegate(AddressOf InvokeEditingStateChanged), New Object() {ChangedBusinessObject, State}) | |
| 339 | ' Else | 339 | ' Else | |
| 340 | ' InvokeEditingStateChanged(ChangedBusinessObject, State) | 340 | ' InvokeEditingStateChanged(ChangedBusinessObject, State) | |
| 341 | ' End If | 341 | ' End If | |
| 342 | 'End Sub | 342 | 'End Sub | |
| 343 | 343 | |||
| 344 | ''' <summary> | 344 | ''' <summary> | |
| 345 | ''' Raises the EditingStateChanged event via Thread Save means. | 345 | ''' Raises the EditingStateChanged event via Thread Save means. | |
| 346 | ''' </summary> | 346 | ''' </summary> | |
| 347 | ''' <remarks></remarks> | 347 | ''' <remarks></remarks> | |
| 348 | Private Sub RaiseBusinessRulesCheckedEvent(ByVal e As BusinessRulesCheckedEventArgs) | 348 | Private Sub RaiseBusinessRulesCheckedEvent(ByVal e As BusinessRulesCheckedEventArgs) | |
| 349 | If InvokeRequired Then | 349 | If InvokeRequired Then | |
| 350 | Invoke(New BusinessRulesChecked_Delegate(AddressOf InvokeBusinessRulesChecked), New Object() {e}) | 350 | Invoke(New BusinessRulesChecked_Delegate(AddressOf InvokeBusinessRulesChecked), New Object() {e}) | |
| 351 | Else | 351 | Else | |
| 352 | InvokeBusinessRulesChecked(e) | 352 | InvokeBusinessRulesChecked(e) | |
| 353 | End If | 353 | End If | |
| 354 | End Sub | 354 | End Sub | |
| 355 | 355 | |||
| 356 | ''' <summary> | 356 | ''' <summary> | |
| 357 | ''' Raises the EditingStateChanged event via Thread Save means. | 357 | ''' Raises the EditingStateChanged event via Thread Save means. | |
| 358 | ''' </summary> | 358 | ''' </summary> | |
| 359 | ''' <remarks></remarks> | 359 | ''' <remarks></remarks> | |
| 360 | Private Sub RaiseUnsavedChangesExistEvent(ByVal e As UnsavedChangesExistEventArgs) | 360 | Private Sub RaiseUnsavedChangesExistEvent(ByVal e As UnsavedChangesExistEventArgs) | |
| 361 | If InvokeRequired Then | 361 | If InvokeRequired Then | |
| 362 | Invoke(New UnsavedChangesExist_Delegate(AddressOf InvokeUnsavedChangesExist), New Object() {e}) | 362 | Invoke(New UnsavedChangesExist_Delegate(AddressOf InvokeUnsavedChangesExist), New Object() {e}) | |
| 363 | Else | 363 | Else | |
| 364 | InvokeUnsavedChangesExist(e) | 364 | InvokeUnsavedChangesExist(e) | |
| 365 | End If | 365 | End If | |
| 366 | End Sub | 366 | End Sub | |
| 367 | 367 | |||
| 368 | #End Region | 368 | #End Region | |
| 369 | 369 | |||
| 370 | #Region " CheckSecurity Event " | 370 | #Region " CheckSecurity Event " | |
| 371 | 371 | |||
| 372 | ''' <summary> | 372 | ''' <summary> | |
| 373 | ''' Represents a method that handles the CheckSecurity event of a base form. | 373 | ''' Represents a method that handles the CheckSecurity event of a base form. | |
| 374 | ''' </summary> | 374 | ''' </summary> | |
| 375 | ''' <param name="e">The CheckSecurity event arguments.</param> | 375 | ''' <param name="e">The CheckSecurity event arguments.</param> | |
| 376 | ''' <remarks></remarks> | 376 | ''' <remarks></remarks> | |
| 377 | Public Delegate Sub CheckSecurityEventHandler(ByVal sender As Object, ByVal e As CheckSecurityEventArgs) | 377 | Public Delegate Sub CheckSecurityEventHandler(ByVal sender As Object, ByVal e As CheckSecurityEventArgs) | |
| 378 | 378 | |||
| 379 | Private _Handler_CheckSecurity As CheckSecurityEventHandler | 379 | Private _Handler_CheckSecurity As CheckSecurityEventHandler | |
| 380 | Private _HandlersPushed_CheckSecurity As New Stack(Of [Delegate]) | 380 | Private _HandlersPushed_CheckSecurity As New Stack(Of [Delegate]) | |
| 381 | Private _HandlersToRem_CheckSecurity As [Delegate] | 381 | Private _HandlersToRem_CheckSecurity As [Delegate] | |
| 382 | 382 | |||
| 383 | ''' <summary> | 383 | ''' <summary> | |
| 384 | ''' Occurs when a call has been made to Edit(), Add(), or Delete() on a business object, but | 384 | ''' Occurs when a call has been made to Edit(), Add(), or Delete() on a business object, but | |
| 385 | ''' before the actual action occurs. This allows the application to check the security for the | 385 | ''' before the actual action occurs. This allows the application to check the security for the | |
| 386 | ''' user that requested the action and allow or deny the action. | 386 | ''' user that requested the action and allow or deny the action. | |
| 387 | ''' </summary> | 387 | ''' </summary> | |
| 388 | ''' <remarks></remarks> | 388 | ''' <remarks></remarks> | |
| 389 | <Category(Business.EVENT_CATEGORY), _ | 389 | <Category(Business.EVENT_CATEGORY), _ | |
| 390 | Description("here")> _ | 390 | Description("here")> _ | |
| 391 | Public Custom Event CheckSecurity As CheckSecurityEventHandler | 391 | Public Custom Event CheckSecurity As CheckSecurityEventHandler | |
| 392 | AddHandler(ByVal value As CheckSecurityEventHandler) | 392 | AddHandler(ByVal value As CheckSecurityEventHandler) | |
| 393 | '-- Add the handler | 393 | '-- Add the handler | |
| 394 | If Me._Handler_CheckSecurity IsNot Nothing Then | 394 | If Me._Handler_CheckSecurity IsNot Nothing Then | |
| 395 | Me._Handler_CheckSecurity = CType([Delegate].Combine(Me._Handler_CheckSecurity, value), CheckSecurityEventHandler) | 395 | Me._Handler_CheckSecurity = CType([Delegate].Combine(Me._Handler_CheckSecurity, value), CheckSecurityEventHandler) | |
| 396 | Else | 396 | Else | |
| 397 | Me._Handler_CheckSecurity = value | 397 | Me._Handler_CheckSecurity = value | |
| 398 | End If | 398 | End If | |
| 399 | End AddHandler | 399 | End AddHandler | |
| 400 | RemoveHandler(ByVal value As CheckSecurityEventHandler) | 400 | RemoveHandler(ByVal value As CheckSecurityEventHandler) | |
| 401 | '-- Remove the handler | 401 | '-- Remove the handler | |
| 402 | If Me._Handler_CheckSecurity IsNot Nothing Then | 402 | If Me._Handler_CheckSecurity IsNot Nothing Then | |
| 403 | Me._Handler_CheckSecurity = CType([Delegate].Remove(Me._Handler_CheckSecurity, value), CheckSecurityEventHandler) | 403 | Me._Handler_CheckSecurity = CType([Delegate].Remove(Me._Handler_CheckSecurity, value), CheckSecurityEventHandler) | |
| 404 | End If | 404 | End If | |
| 405 | End RemoveHandler | 405 | End RemoveHandler | |
| 406 | RaiseEvent(ByVal sender As Object, ByVal e As CheckSecurityEventArgs) | 406 | RaiseEvent(ByVal sender As Object, ByVal e As CheckSecurityEventArgs) | |
| 407 | '-- See if we can directly invoke the event | 407 | '-- See if we can directly invoke the event | |
| 408 | If Me._Handler_CheckSecurity IsNot Nothing Then | 408 | If Me._Handler_CheckSecurity IsNot Nothing Then | |
| 409 | If (Me.InvokeRequired) Then | 409 | If (Me.InvokeRequired) Then | |
| 410 | Me.Invoke(Me._Handler_CheckSecurity, New Object() {sender, e}) | 410 | Me.Invoke(Me._Handler_CheckSecurity, New Object() {sender, e}) | |
| 411 | Else | 411 | Else | |
| 412 | Me._Handler_CheckSecurity.Invoke(sender, e) | 412 | Me._Handler_CheckSecurity.Invoke(sender, e) | |
| 413 | End If | 413 | End If | |
| 414 | End If | 414 | End If | |
| 415 | End RaiseEvent | 415 | End RaiseEvent | |
| 416 | End Event | 416 | End Event | |
| 417 | 417 | |||
| 418 | ''' <summary> | 418 | ''' <summary> | |
| 419 | ''' Raises the MicroFour.StrataFrame.Business.BusinessLayer.CheckSecurity event. | 419 | ''' Raises the MicroFour.StrataFrame.Business.BusinessLayer.CheckSecurity event. | |
| 420 | ''' </summary> | 420 | ''' </summary> | |
| 421 | ''' <param name="e"></param> | 421 | ''' <param name="e"></param> | |
| 422 | ''' <remarks></remarks> | 422 | ''' <remarks></remarks> | |
| 423 | Protected Overridable Sub OnCheckSecurity(ByVal e As CheckSecurityEventArgs) | 423 | Protected Overridable Sub OnCheckSecurity(ByVal e As CheckSecurityEventArgs) | |
| 424 | RaiseEvent CheckSecurity(Me, e) | 424 | RaiseEvent CheckSecurity(Me, e) | |
| 425 | End Sub | 425 | End Sub | |
| 426 | 426 | |||
| 427 | #End Region | 427 | #End Region | |
| 428 | 428 | |||
| 429 | #Region " Security Denied Event " | 429 | #Region " Security Denied Event " | |
| 430 | 430 | |||
| 431 | ''' <summary> | 431 | ''' <summary> | |
| 432 | ''' Represents a method that handles the SecurityDenied event of a form. | 432 | ''' Represents a method that handles the SecurityDenied event of a form. | |
| 433 | ''' </summary> | 433 | ''' </summary> | |
| 434 | ''' <param name="e">The SecurityDenied event arguments.</param> | 434 | ''' <param name="e">The SecurityDenied event arguments.</param> | |
| 435 | ''' <remarks></remarks> | 435 | ''' <remarks></remarks> | |
| 436 | Public Delegate Sub SecurityDeniedEventHandler(ByVal sender As Object, ByVal e As SecurityDeniedEventArgs) | 436 | Public Delegate Sub SecurityDeniedEventHandler(ByVal sender As Object, ByVal e As SecurityDeniedEventArgs) | |
| 437 | 437 | |||
| 438 | Private _Handler_SecurityDenied As SecurityDeniedEventHandler | 438 | Private _Handler_SecurityDenied As SecurityDeniedEventHandler | |
| 439 | 439 | |||
| 440 | ''' <summary> | 440 | ''' <summary> | |
| 441 | ''' Occurs when a requested action such as an Add(), Edit() or Delete() on a business object | 441 | ''' Occurs when a requested action such as an Add(), Edit() or Delete() on a business object | |
| 442 | ''' is denied through the CheckSecurityEvent(). | 442 | ''' is denied through the CheckSecurityEvent(). | |
| 443 | ''' </summary> | 443 | ''' </summary> | |
| 444 | ''' <remarks></remarks> | 444 | ''' <remarks></remarks> | |
| 445 | <Category(Business.EVENT_CATEGORY), _ | 445 | <Category(Business.EVENT_CATEGORY), _ | |
| 446 | Description("here")> _ | 446 | Description("here")> _ | |
| 447 | Public Custom Event SecurityDenied As SecurityDeniedEventHandler | 447 | Public Custom Event SecurityDenied As SecurityDeniedEventHandler | |
| 448 | AddHandler(ByVal value As SecurityDeniedEventHandler) | 448 | AddHandler(ByVal value As SecurityDeniedEventHandler) | |
| 449 | '-- Add the handler | 449 | '-- Add the handler | |
| 450 | If Me._Handler_SecurityDenied IsNot Nothing Then | 450 | If Me._Handler_SecurityDenied IsNot Nothing Then | |
| 451 | Me._Handler_SecurityDenied = CType([Delegate].Combine(Me._Handler_SecurityDenied, value), SecurityDeniedEventHandler) | 451 | Me._Handler_SecurityDenied = CType([Delegate].Combine(Me._Handler_SecurityDenied, value), SecurityDeniedEventHandler) | |
| 452 | Else | 452 | Else | |
| 453 | Me._Handler_SecurityDenied = value | 453 | Me._Handler_SecurityDenied = value | |
| 454 | End If | 454 | End If | |
| 455 | End AddHandler | 455 | End AddHandler | |
| 456 | RemoveHandler(ByVal value As SecurityDeniedEventHandler) | 456 | RemoveHandler(ByVal value As SecurityDeniedEventHandler) | |
| 457 | '-- Remove the handler | 457 | '-- Remove the handler | |
| 458 | If Me._Handler_SecurityDenied IsNot Nothing Then | 458 | If Me._Handler_SecurityDenied IsNot Nothing Then | |
| 459 | Me._Handler_SecurityDenied = CType([Delegate].Remove(Me._Handler_SecurityDenied, value), SecurityDeniedEventHandler) | 459 | Me._Handler_SecurityDenied = CType([Delegate].Remove(Me._Handler_SecurityDenied, value), SecurityDeniedEventHandler) | |
| 460 | End If | 460 | End If | |
| 461 | End RemoveHandler | 461 | End RemoveHandler | |
| 462 | RaiseEvent(ByVal sender As Object, ByVal e As SecurityDeniedEventArgs) | 462 | RaiseEvent(ByVal sender As Object, ByVal e As SecurityDeniedEventArgs) | |
| 463 | '-- See if we can directly invoke the event | 463 | '-- See if we can directly invoke the event | |
| 464 | If Me._Handler_SecurityDenied IsNot Nothing Then | 464 | If Me._Handler_SecurityDenied IsNot Nothing Then | |
| 465 | If (Me.InvokeRequired) Then | 465 | If (Me.InvokeRequired) Then | |
| 466 | Me.Invoke(Me._Handler_SecurityDenied, New Object() {sender, e}) | 466 | Me.Invoke(Me._Handler_SecurityDenied, New Object() {sender, e}) | |
| 467 | Else | 467 | Else | |
| 468 | Me._Handler_SecurityDenied.Invoke(sender, e) | 468 | Me._Handler_SecurityDenied.Invoke(sender, e) | |
| 469 | End If | 469 | End If | |
| 470 | End If | 470 | End If | |
| 471 | End RaiseEvent | 471 | End RaiseEvent | |
| 472 | End Event | 472 | End Event | |
| 473 | 473 | |||
| 474 | ''' <summary> | 474 | ''' <summary> | |
| 475 | ''' Raises the SecurityDenied event. | 475 | ''' Raises the SecurityDenied event. | |
| 476 | ''' </summary> | 476 | ''' </summary> | |
| 477 | ''' <param name="e"></param> | 477 | ''' <param name="e"></param> | |
| 478 | ''' <remarks></remarks> | 478 | ''' <remarks></remarks> | |
| 479 | Protected Overridable Sub OnSecurityDenied(ByVal e As SecurityDeniedEventArgs, ByVal ShouldRaiseEvent As Boolean) | 479 | Protected Overridable Sub OnSecurityDenied(ByVal e As SecurityDeniedEventArgs, ByVal ShouldRaiseEvent As Boolean) | |
| 480 | If ShouldRaiseEvent Then | 480 | If ShouldRaiseEvent Then | |
| 481 | RaiseEvent SecurityDenied(Me, e) | 481 | RaiseEvent SecurityDenied(Me, e) | |
| 482 | End If | 482 | End If | |
| 483 | 483 | |||
| 484 | '-- Determine whether the event should be automatically handled | 484 | '-- Determine whether the event should be automatically handled | |
| 485 | If Me._AutoShowSecurityDenied Then | 485 | If Me._AutoShowSecurityDenied Then | |
| 486 | '-- We need to show the message | 486 | '-- We need to show the message | |
| 487 | Select Case e.PermissionInfo.Action | 487 | Select Case e.PermissionInfo.Action | |
| 488 | Case PermissionAction.Deny | 488 | Case PermissionAction.Deny | |
| 489 | '-- Determine how to show the message | 489 | '-- Determine how to show the message | |
| 490 | Select Case e.PermissionInfo.DenyAction | 490 | Select Case e.PermissionInfo.DenyAction | |
| 491 | Case DeniedActions.NoMessage, DeniedActions.ReplaceEachCharacter | 491 | Case DeniedActions.NoMessage, DeniedActions.ReplaceEachCharacter | |
| 492 | '-- Show the default message | 492 | '-- Show the default message | |
| 493 | MessageForm.ShowMessage(SecurityBasics.DefaultBlockedMsg) | 493 | MessageForm.ShowMessage(SecurityBasics.DefaultBlockedMsg) | |
| 494 | 494 | |||
| 495 | Case DeniedActions.Message | 495 | Case DeniedActions.Message | |
| 496 | '-- Show the message | 496 | '-- Show the message | |
| 497 | If String.IsNullOrEmpty(e.PermissionInfo.BlockedMessageOrKey) Then | 497 | If String.IsNullOrEmpty(e.PermissionInfo.BlockedMessageOrKey) Then | |
| 498 | MessageForm.ShowMessage(SecurityBasics.DefaultBlockedMsg) | 498 | MessageForm.ShowMessage(SecurityBasics.DefaultBlockedMsg) | |
| 499 | Else | 499 | Else | |
| 500 | MessageForm.ShowMessage(e.PermissionInfo.BlockedMessageOrKey) | 500 | MessageForm.ShowMessage(e.PermissionInfo.BlockedMessageOrKey) | |
| 501 | End If | 501 | End If | |
| 502 | 502 | |||
| 503 | Case DeniedActions.MessageKey | 503 | Case DeniedActions.MessageKey | |
| 504 | '-- Show the message by key | 504 | '-- Show the message by key | |
| 505 | If String.IsNullOrEmpty(e.PermissionInfo.BlockedMessageOrKey) Then | 505 | If String.IsNullOrEmpty(e.PermissionInfo.BlockedMessageOrKey) Then | |
| 506 | MessageForm.ShowMessageByKey(SecurityBasics.DefaultBlockedMsgKey) | 506 | MessageForm.ShowMessageByKey(SecurityBasics.DefaultBlockedMsgKey) | |
| 507 | Else | 507 | Else | |
| 508 | MessageForm.ShowMessageByKey(e.PermissionInfo.BlockedMessageOrKey) | 508 | MessageForm.ShowMessageByKey(e.PermissionInfo.BlockedMessageOrKey) | |
| 509 | End If | 509 | End If | |
| 510 | End Select | 510 | End Select | |
| 511 | Case PermissionAction.Grant | 511 | Case PermissionAction.Grant | |
| 512 | '-- Do nothing, since it was not denied | 512 | '-- Do nothing, since it was not denied | |
| 513 | 513 | |||
| 514 | Case PermissionAction.ReadOnly | 514 | Case PermissionAction.ReadOnly | |
| 515 | '-- Do nothing, since the form is readonly | 515 | '-- Do nothing, since the form is readonly | |
| 516 | End Select | 516 | End Select | |
| 517 | End If | 517 | End If | |
| 518 | End Sub | 518 | End Sub | |
| 519 | 519 | |||
| 520 | #End Region | 520 | #End Region | |
| 521 | 521 | |||
| 522 | #End Region | 522 | #End Region | |
| 523 | 523 | |||
| 524 | #Region " Private Fields " | 524 | #Region " Private Fields " | |
| 525 | 525 | |||
| 526 | '-- Instance Privates | 526 | '-- Instance Privates | |
| 527 | Private _BusinessObjects As New BusinessObjectCollection() | 527 | Private _BusinessObjects As New BusinessObjectCollection() | |
| 528 | Private _FocusControlOnEdit As Control = Nothing | 528 | Private _FocusControlOnEdit As Control = Nothing | |
| 529 | Private _FocusControlOnAdd As Control = Nothing | 529 | Private _FocusControlOnAdd As Control = Nothing | |
| 530 | Private _PrimaryBusinessObject As BusinessLayer = Nothing | 530 | Private _PrimaryBusinessObject As BusinessLayer = Nothing | |
| 531 | 531 | |||
| 532 | Private _UseErrorProvider As Boolean = True | 532 | Private _UseErrorProvider As Boolean = True | |
| 533 | Private _ErrorProviderIcon As Icon = My.Resources.error_provider_16 | 533 | Private _ErrorProviderIcon As Icon = My.Resources.error_provider_16 | |
| 534 | Private _ErrorProviderIconAlignment As System.Windows.Forms.ErrorIconAlignment = ErrorIconAlignment.MiddleRight | 534 | Private _ErrorProviderIconAlignment As System.Windows.Forms.ErrorIconAlignment = ErrorIconAlignment.MiddleRight | |
| 535 | Private _ErrorProviderBlinkRate As Integer = 150 | 535 | Private _ErrorProviderBlinkRate As Integer = 150 | |
| 536 | Private _ErrorProviderBlinkStyle As ErrorBlinkStyle = ErrorBlinkStyle.BlinkIfDifferentError | 536 | Private _ErrorProviderBlinkStyle As ErrorBlinkStyle = ErrorBlinkStyle.BlinkIfDifferentError | |
| 537 | Private _ErrorProviderIconPadding As Integer = -9 | 537 | Private _ErrorProviderIconPadding As Integer = -9 | |
| 538 | Private _ErrorProvider As ErrorProvider | 538 | Private _ErrorProvider As ErrorProvider | |
| 539 | Private _ErrorProviderRequiredFieldDescText As String = Localization.RetrieveTextValue(EPRFD_DEFAULT, "This field requires entry.") | 539 | Private _ErrorProviderRequiredFieldDescText As String = Localization.RetrieveTextValue(EPRFD_DEFAULT, "This field requires entry.") | |
| 540 | Private _ErrorProviderRequiredFieldDescKey As String = "" | 540 | Private _ErrorProviderRequiredFieldDescKey As String = "" | |
| 541 | 541 | |||
| 542 | Private _AutoShowBrokenRulesAlert As Boolean = True | 542 | Private _AutoShowBrokenRulesAlert As Boolean = True | |
| 543 | Private _BrokenRulesAlertTitleText As String = Localization.RetrieveTextValue(BRAT_DEFAULT, "Broken Rules Exist") | 543 | Private _BrokenRulesAlertTitleText As String = Localization.RetrieveTextValue(BRAT_DEFAULT, "Broken Rules Exist") | |
| 544 | Private _BrokenRulesAlertTitleKey As String = "" | 544 | Private _BrokenRulesAlertTitleKey As String = "" | |
| 545 | Private _BrokenRulesAlertTextText As String = Localization.RetrieveTextValue(BRAM_DEFAULT, "There are {0} broken rules that need to be corrected.") | 545 | Private _BrokenRulesAlertTextText As String = Localization.RetrieveTextValue(BRAM_DEFAULT, "There are {0} broken rules that need to be corrected.") | |
| 546 | Private _BrokenRulesAlertTextKey As String = "" | 546 | Private _BrokenRulesAlertTextKey As String = "" | |
| 547 | Private _BrokenRulesAlertTextMoreThanOneRowText As String = Localization.RetrieveTextValue(BRAMMTOR_DEFAULT, "There are {0} broken rules that need to be corrected on the current record, and there are {1} broken rules on additional records.") | 547 | Private _BrokenRulesAlertTextMoreThanOneRowText As String = Localization.RetrieveTextValue(BRAMMTOR_DEFAULT, "There are {0} broken rules that need to be corrected on the current record, and there are {1} broken rules on additional records.") | |
| 548 | Private _BrokenRulesAlertTextMoreThanOneRowKey As String = "" | 548 | Private _BrokenRulesAlertTextMoreThanOneRowKey As String = "" | |
| 549 | Private _AutoShowDeleteConfirmation As Boolean = True | 549 | Private _AutoShowDeleteConfirmation As Boolean = True | |
| 550 | Private _AutoDeleteTitleText As String = Localization.RetrieveTextValue(ADT_DEFAULT, "Delete Record?") | 550 | Private _AutoDeleteTitleText As String = Localization.RetrieveTextValue(ADT_DEFAULT, "Delete Record?") | |
| 551 | Private _AutoDeleteTitleKey As String = "" | 551 | Private _AutoDeleteTitleKey As String = "" | |
| 552 | Private _AutoDeleteMessageText As String = Localization.RetrieveTextValue(ADM_DEFAULT, "Are you sure you wish to delete the current record?") | 552 | Private _AutoDeleteMessageText As String = Localization.RetrieveTextValue(ADM_DEFAULT, "Are you sure you wish to delete the current record?") | |
| 553 | Private _AutoDeleteMessageKey As String = "" | 553 | Private _AutoDeleteMessageKey As String = "" | |
| 554 | Private _AutoShowSaveChangesMessage As Boolean = True | 554 | Private _AutoShowSaveChangesMessage As Boolean = True | |
| 555 | Private _AutoSaveChangesTitleText As String = Localization.RetrieveTextValue(ASCT_DEFAULT, "Save Changes?") | 555 | Private _AutoSaveChangesTitleText As String = Localization.RetrieveTextValue(ASCT_DEFAULT, "Save Changes?") | |
| 556 | Private _AutoSaveChangesTitleKey As String = "" | 556 | Private _AutoSaveChangesTitleKey As String = "" | |
| 557 | Private _AutoSaveChangesMessageText As String = Localization.RetrieveTextValue(ASCM_DEFAULT, "Do you want to save changes?") | 557 | Private _AutoSaveChangesMessageText As String = Localization.RetrieveTextValue(ASCM_DEFAULT, "Do you want to save changes?") | |
| 558 | Private _AutoSaveChangesMessageKey As String = "" | 558 | Private _AutoSaveChangesMessageKey As String = "" | |
| 559 | Private _AutoHandleCollisions As Boolean = True | 559 | Private _AutoHandleCollisions As Boolean = True | |
| 560 | Private _AutoShowSavingErrors As Boolean = True | 560 | Private _AutoShowSavingErrors As Boolean = True | |
| 561 | Private _AutoShowSecurityDenied As Boolean = True | 561 | Private _AutoShowSecurityDenied As Boolean = True | |
| 562 | Private _FormAborted As Boolean = False | 562 | Private _FormAborted As Boolean = False | |
| 563 | Private _IsChildForm As Boolean = False | 563 | Private _IsChildForm As Boolean = False | |
| 564 | Private _MouseLocation As New Point(0, 0) | 564 | Private _MouseLocation As New Point(0, 0) | |
| 565 | Private _ObjectsToInitOnLoad As New List(Of IInitOnFormLoad) | 565 | Private _ObjectsToInitOnLoad As New List(Of IInitOnFormLoad) | |
| 566 | Private _ObjectsToPreInitOnLoad As New List(Of IPreInitOnFormLoad) | 566 | Private _ObjectsToPreInitOnLoad As New List(Of IPreInitOnFormLoad) | |
| 567 | Private _RegistryStore As New RegistryRepository() | 567 | Private _RegistryStore As New RegistryRepository() | |
| 568 | Private _RememberFormLocation As Boolean = True | 568 | Private _RememberFormLocation As Boolean = True | |
| 569 | Private _RememberFormMaximizedState As Boolean = True | 569 | Private _RememberFormMaximizedState As Boolean = True | |
| 570 | Private _RememberFormSize As Boolean = True | 570 | Private _RememberFormSize As Boolean = True | |
| 571 | Private _SecurityChecked As Boolean = False | 571 | Private _SecurityChecked As Boolean = False | |
| 572 | Private _ViewSecurityKey As String = String.Empty | 572 | Private _ViewSecurityKey As String = String.Empty | |
| 573 | 573 | |||
| 574 | '-- Include in form options | 574 | '-- Include in form options | |
| 575 | Private _IncludeInFormAddType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | 575 | Private _IncludeInFormAddType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 576 | Private _IncludeInFormDeleteType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | 576 | Private _IncludeInFormDeleteType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 577 | Private _IncludeInFormEditType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | 577 | Private _IncludeInFormEditType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 578 | Private _IncludeInFormNavigateType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | 578 | Private _IncludeInFormNavigateType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 579 | Private _IncludeInFormSaveType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.AllBusinessObjects | 579 | Private _IncludeInFormSaveType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.AllBusinessObjects | |
| 580 | Private _IncludeInFormUndoType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | 580 | Private _IncludeInFormUndoType As IncludeInFormTypeOptions = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 581 | 581 | |||
| 582 | '-- Private Constants | 582 | '-- Private Constants | |
| 583 | Private Const FORM_HEIGHT_VALUE_NAME As String = "SF_FormHeight" | 583 | Private Const FORM_HEIGHT_VALUE_NAME As String = "SF_FormHeight" | |
| 584 | Private Const FORM_WIDTH_VALUE_NAME As String = "SF_FormWidth" | 584 | Private Const FORM_WIDTH_VALUE_NAME As String = "SF_FormWidth" | |
| 585 | Private Const FORM_X_VALUE_NAME As String = "SF_FormX" | 585 | Private Const FORM_X_VALUE_NAME As String = "SF_FormX" | |
| 586 | Private Const FORM_Y_VALUE_NAME As String = "SF_FormY" | 586 | Private Const FORM_Y_VALUE_NAME As String = "SF_FormY" | |
| 587 | Private Const FORM_STATE_VALUE_NAME As String = "SF_FormState" | 587 | Private Const FORM_STATE_VALUE_NAME As String = "SF_FormState" | |
| 588 | 588 | |||
| 589 | #End Region | 589 | #End Region | |
| 590 | 590 | |||
| 591 | #Region " Private Properties " | 591 | #Region " Private Properties " | |
| 592 | 592 | |||
| 593 | Private Const CANNOT_EVALUATE As String = "Cannot be evaluated at design-time when the corresponding key is set." | 593 | Private Const CANNOT_EVALUATE As String = "Cannot be evaluated at design-time when the corresponding key is set." | |
| 594 | 594 | |||
| 595 | Private ReadOnly Property _ErrorProviderRequiredFieldDesc() As String | 595 | Private ReadOnly Property _ErrorProviderRequiredFieldDesc() As String | |
| 596 | Get | 596 | Get | |
| 597 | If Me.DesignMode Then | 597 | If Me.DesignMode Then | |
| 598 | If _ErrorProviderRequiredFieldDescKey.Trim().Length() > 0 Then | 598 | If _ErrorProviderRequiredFieldDescKey.Trim().Length() > 0 Then | |
| 599 | Return CANNOT_EVALUATE | 599 | Return CANNOT_EVALUATE | |
| 600 | Else | 600 | Else | |
| 601 | Return _ErrorProviderRequiredFieldDescText | 601 | Return _ErrorProviderRequiredFieldDescText | |
| 602 | End If | 602 | End If | |
| 603 | Else | 603 | Else | |
| 604 | Return Localization.RetrieveTextValue(_ErrorProviderRequiredFieldDescKey, _ErrorProviderRequiredFieldDescText) | 604 | Return Localization.RetrieveTextValue(_ErrorProviderRequiredFieldDescKey, _ErrorProviderRequiredFieldDescText) | |
| 605 | End If | 605 | End If | |
| 606 | End Get | 606 | End Get | |
| 607 | End Property | 607 | End Property | |
| 608 | 608 | |||
| 609 | Private ReadOnly Property _AutoDeleteTitle() As String | 609 | Private ReadOnly Property _AutoDeleteTitle() As String | |
| 610 | Get | 610 | Get | |
| 611 | If Me.DesignMode Then | 611 | If Me.DesignMode Then | |
| 612 | If _AutoDeleteTitleKey.Trim().Length > 0 Then | 612 | If _AutoDeleteTitleKey.Trim().Length > 0 Then | |
| 613 | Return CANNOT_EVALUATE | 613 | Return CANNOT_EVALUATE | |
| 614 | Else | 614 | Else | |
| 615 | Return _AutoDeleteTitleText | 615 | Return _AutoDeleteTitleText | |
| 616 | End If | 616 | End If | |
| 617 | Else | 617 | Else | |
| 618 | Return Localization.RetrieveTextValue(_AutoDeleteTitleKey, _AutoDeleteTitleText) | 618 | Return Localization.RetrieveTextValue(_AutoDeleteTitleKey, _AutoDeleteTitleText) | |
| 619 | End If | 619 | End If | |
| 620 | End Get | 620 | End Get | |
| 621 | End Property | 621 | End Property | |
| 622 | 622 | |||
| 623 | Private ReadOnly Property _AutoDeleteMessage() As String | 623 | Private ReadOnly Property _AutoDeleteMessage() As String | |
| 624 | Get | 624 | Get | |
| 625 | If Me.DesignMode Then | 625 | If Me.DesignMode Then | |
| 626 | If _AutoDeleteMessageKey.Trim().Length > 0 Then | 626 | If _AutoDeleteMessageKey.Trim().Length > 0 Then | |
| 627 | Return CANNOT_EVALUATE | 627 | Return CANNOT_EVALUATE | |
| 628 | Else | 628 | Else | |
| 629 | Return _AutoDeleteMessageText | 629 | Return _AutoDeleteMessageText | |
| 630 | End If | 630 | End If | |
| 631 | Else | 631 | Else | |
| 632 | Return Localization.RetrieveTextValue(_AutoDeleteMessageKey, _AutoDeleteMessageText) | 632 | Return Localization.RetrieveTextValue(_AutoDeleteMessageKey, _AutoDeleteMessageText) | |
| 633 | End If | 633 | End If | |
| 634 | End Get | 634 | End Get | |
| 635 | End Property | 635 | End Property | |
| 636 | 636 | |||
| 637 | Private ReadOnly Property _AutoSaveChangesTitle() As String | 637 | Private ReadOnly Property _AutoSaveChangesTitle() As String | |
| 638 | Get | 638 | Get | |
| 639 | If Me.DesignMode Then | 639 | If Me.DesignMode Then | |
| 640 | If _AutoSaveChangesTitleKey.Trim().Length > 0 Then | 640 | If _AutoSaveChangesTitleKey.Trim().Length > 0 Then | |
| 641 | Return CANNOT_EVALUATE | 641 | Return CANNOT_EVALUATE | |
| 642 | Else | 642 | Else | |
| 643 | Return _AutoSaveChangesTitleText | 643 | Return _AutoSaveChangesTitleText | |
| 644 | End If | 644 | End If | |
| 645 | Else | 645 | Else | |
| 646 | Return Localization.RetrieveTextValue(_AutoSaveChangesTitleKey, _AutoSaveChangesTitleText) | 646 | Return Localization.RetrieveTextValue(_AutoSaveChangesTitleKey, _AutoSaveChangesTitleText) | |
| 647 | End If | 647 | End If | |
| 648 | End Get | 648 | End Get | |
| 649 | End Property | 649 | End Property | |
| 650 | 650 | |||
| 651 | Private ReadOnly Property _AutoSaveChangesMessage() As String | 651 | Private ReadOnly Property _AutoSaveChangesMessage() As String | |
| 652 | Get | 652 | Get | |
| 653 | If Me.DesignMode Then | 653 | If Me.DesignMode Then | |
| 654 | If _AutoSaveChangesMessageKey.Trim().Length > 0 Then | 654 | If _AutoSaveChangesMessageKey.Trim().Length > 0 Then | |
| 655 | Return CANNOT_EVALUATE | 655 | Return CANNOT_EVALUATE | |
| 656 | Else | 656 | Else | |
| 657 | Return _AutoSaveChangesMessageText | 657 | Return _AutoSaveChangesMessageText | |
| 658 | End If | 658 | End If | |
| 659 | Else | 659 | Else | |
| 660 | Return Localization.RetrieveTextValue(_AutoSaveChangesMessageKey, _AutoSaveChangesMessageText) | 660 | Return Localization.RetrieveTextValue(_AutoSaveChangesMessageKey, _AutoSaveChangesMessageText) | |
| 661 | End If | 661 | End If | |
| 662 | End Get | 662 | End Get | |
| 663 | End Property | 663 | End Property | |
| 664 | 664 | |||
| 665 | Private ReadOnly Property _BrokenRulesAlertTitle() As String | 665 | Private ReadOnly Property _BrokenRulesAlertTitle() As String | |
| 666 | Get | 666 | Get | |
| 667 | If Me.DesignMode Then | 667 | If Me.DesignMode Then | |
| 668 | If _BrokenRulesAlertTitleKey.Trim().Length > 0 Then | 668 | If _BrokenRulesAlertTitleKey.Trim().Length > 0 Then | |
| 669 | Return CANNOT_EVALUATE | 669 | Return CANNOT_EVALUATE | |
| 670 | Else | 670 | Else | |
| 671 | Return _BrokenRulesAlertTitleText | 671 | Return _BrokenRulesAlertTitleText | |
| 672 | End If | 672 | End If | |
| 673 | Else | 673 | Else | |
| 674 | Return Localization.RetrieveTextValue(_BrokenRulesAlertTitleKey, _BrokenRulesAlertTitleText) | 674 | Return Localization.RetrieveTextValue(_BrokenRulesAlertTitleKey, _BrokenRulesAlertTitleText) | |
| 675 | End If | 675 | End If | |
| 676 | End Get | 676 | End Get | |
| 677 | End Property | 677 | End Property | |
| 678 | 678 | |||
| 679 | Private ReadOnly Property _BrokenRulesAlertText() As String | 679 | Private ReadOnly Property _BrokenRulesAlertText() As String | |
| 680 | Get | 680 | Get | |
| 681 | If Me.DesignMode Then | 681 | If Me.DesignMode Then | |
| 682 | If _BrokenRulesAlertTextKey.Trim().Length > 0 Then | 682 | If _BrokenRulesAlertTextKey.Trim().Length > 0 Then | |
| 683 | Return CANNOT_EVALUATE | 683 | Return CANNOT_EVALUATE | |
| 684 | Else | 684 | Else | |
| 685 | Return _BrokenRulesAlertTextText | 685 | Return _BrokenRulesAlertTextText | |
| 686 | End If | 686 | End If | |
| 687 | Else | 687 | Else | |
| 688 | Return Localization.RetrieveTextValue(_BrokenRulesAlertTextKey, _BrokenRulesAlertTextText) | 688 | Return Localization.RetrieveTextValue(_BrokenRulesAlertTextKey, _BrokenRulesAlertTextText) | |
| 689 | End If | 689 | End If | |
| 690 | End Get | 690 | End Get | |
| 691 | End Property | 691 | End Property | |
| 692 | 692 | |||
| 693 | Private ReadOnly Property _BrokenRulesAlertTextMoreThanOneRow() As String | 693 | Private ReadOnly Property _BrokenRulesAlertTextMoreThanOneRow() As String | |
| 694 | Get | 694 | Get | |
| 695 | If Me.DesignMode Then | 695 | If Me.DesignMode Then | |
| 696 | If _BrokenRulesAlertTextMoreThanOneRowKey.Trim().Length > 0 Then | 696 | If _BrokenRulesAlertTextMoreThanOneRowKey.Trim().Length > 0 Then | |
| 697 | Return CANNOT_EVALUATE | 697 | Return CANNOT_EVALUATE | |
| 698 | Else | 698 | Else | |
| 699 | Return _BrokenRulesAlertTextMoreThanOneRowText | 699 | Return _BrokenRulesAlertTextMoreThanOneRowText | |
| 700 | End If | 700 | End If | |
| 701 | Else | 701 | Else | |
| 702 | Return Localization.RetrieveTextValue(_BrokenRulesAlertTextMoreThanOneRowKey, _BrokenRulesAlertTextMoreThanOneRowText) | 702 | Return Localization.RetrieveTextValue(_BrokenRulesAlertTextMoreThanOneRowKey, _BrokenRulesAlertTextMoreThanOneRowText) | |
| 703 | End If | 703 | End If | |
| 704 | End Get | 704 | End Get | |
| 705 | End Property | 705 | End Property | |
| 706 | 706 | |||
| 707 | #End Region | 707 | #End Region | |
| 708 | 708 | |||
| 709 | #Region " Public Properties " | 709 | #Region " Public Properties " | |
| 710 | 710 | |||
| 711 | ''' <summary> | 711 | ''' <summary> | |
| 712 | ''' Gets or sets the path to the registry key where this form will store settings. | 712 | ''' Gets or sets the path to the registry key where this form will store settings. | |
| 713 | ''' </summary> | 713 | ''' </summary> | |
| 714 | ''' <value></value> | 714 | ''' <value></value> | |
| 715 | ''' <returns></returns> | 715 | ''' <returns></returns> | |
| 716 | ''' <remarks></remarks> | 716 | ''' <remarks></remarks> | |
| 717 | <Category(REGISTRY_CATEGORY), _ | 717 | <Category(REGISTRY_CATEGORY), _ | |
| 718 | DefaultValue(""), _ | 718 | DefaultValue(""), _ | |
| 719 | Description("The path to the registry key where this form will store settings.")> _ | 719 | Description("The path to the registry key where this form will store settings.")> _ | |
| 720 | Public Property RegistryRepositoryKey() As String | 720 | Public Property RegistryRepositoryKey() As String | |
| 721 | Get | 721 | Get | |
| 722 | Return Me._RegistryStore.RegistryKey | 722 | Return Me._RegistryStore.RegistryKey | |
| 723 | End Get | 723 | End Get | |
| 724 | Set(ByVal value As String) | 724 | Set(ByVal value As String) | |
| 725 | Me._RegistryStore.RegistryKey = value | 725 | Me._RegistryStore.RegistryKey = value | |
| 726 | End Set | 726 | End Set | |
| 727 | End Property | 727 | End Property | |
| 728 | 728 | |||
| 729 | ''' <summary> | 729 | ''' <summary> | |
| 730 | ''' Gets or sets a value that determines whether this form will remember its location when | 730 | ''' Gets or sets a value that determines whether this form will remember its location when | |
| 731 | ''' closed and reopened. | 731 | ''' closed and reopened. | |
| 732 | ''' </summary> | 732 | ''' </summary> | |
| 733 | ''' <value></value> | 733 | ''' <value></value> | |
| 734 | ''' <returns></returns> | 734 | ''' <returns></returns> | |
| 735 | ''' <remarks></remarks> | 735 | ''' <remarks></remarks> | |
| 736 | <Category(REGISTRY_CATEGORY), _ | 736 | <Category(REGISTRY_CATEGORY), _ | |
| 737 | DefaultValue(True), _ | 737 | DefaultValue(True), _ | |
| 738 | Description("Determines whether this form will remember its location when closed and reopened.")> _ | 738 | Description("Determines whether this form will remember its location when closed and reopened.")> _ | |
| 739 | Public Property RememberFormLocation() As Boolean | 739 | Public Property RememberFormLocation() As Boolean | |
| 740 | Get | 740 | Get | |
| 741 | Return Me._RememberFormLocation | 741 | Return Me._RememberFormLocation | |
| 742 | End Get | 742 | End Get | |
| 743 | Set(ByVal value As Boolean) | 743 | Set(ByVal value As Boolean) | |
| 744 | Me._RememberFormLocation = value | 744 | Me._RememberFormLocation = value | |
| 745 | End Set | 745 | End Set | |
| 746 | End Property | 746 | End Property | |
| 747 | 747 | |||
| 748 | ''' <summary> | 748 | ''' <summary> | |
| 749 | ''' Gets or sets a value that determines whether this form will remember its maximized state | 749 | ''' Gets or sets a value that determines whether this form will remember its maximized state | |
| 750 | ''' when closed and reopened. | 750 | ''' when closed and reopened. | |
| 751 | ''' </summary> | 751 | ''' </summary> | |
| 752 | ''' <value></value> | 752 | ''' <value></value> | |
| 753 | ''' <returns></returns> | 753 | ''' <returns></returns> | |
| 754 | ''' <remarks></remarks> | 754 | ''' <remarks></remarks> | |
| 755 | <Category(REGISTRY_CATEGORY), _ | 755 | <Category(REGISTRY_CATEGORY), _ | |
| 756 | DefaultValue(True), _ | 756 | DefaultValue(True), _ | |
| 757 | Description("Determines whether this form will remember its maximized state when closed and reopened.")> _ | 757 | Description("Determines whether this form will remember its maximized state when closed and reopened.")> _ | |
| 758 | Public Property RememberFormMaximizedState() As Boolean | 758 | Public Property RememberFormMaximizedState() As Boolean | |
| 759 | Get | 759 | Get | |
| 760 | Return Me._RememberFormMaximizedState | 760 | Return Me._RememberFormMaximizedState | |
| 761 | End Get | 761 | End Get | |
| 762 | Set(ByVal value As Boolean) | 762 | Set(ByVal value As Boolean) | |
| 763 | Me._RememberFormMaximizedState = value | 763 | Me._RememberFormMaximizedState = value | |
| 764 | End Set | 764 | End Set | |
| 765 | End Property | 765 | End Property | |
| 766 | 766 | |||
| 767 | ''' <summary> | 767 | ''' <summary> | |
| 768 | ''' Gets or sets a value that determines whether this form will remember its size when closed and | 768 | ''' Gets or sets a value that determines whether this form will remember its size when closed and | |
| 769 | ''' reopened. | 769 | ''' reopened. | |
| 770 | ''' </summary> | 770 | ''' </summary> | |
| 771 | ''' <value></value> | 771 | ''' <value></value> | |
| 772 | ''' <returns></returns> | 772 | ''' <returns></returns> | |
| 773 | ''' <remarks></remarks> | 773 | ''' <remarks></remarks> | |
| 774 | <Category(REGISTRY_CATEGORY), _ | 774 | <Category(REGISTRY_CATEGORY), _ | |
| 775 | DefaultValue(True), _ | 775 | DefaultValue(True), _ | |
| 776 | Description("Determines whether this form will remember its size when closed and reopened.")> _ | 776 | Description("Determines whether this form will remember its size when closed and reopened.")> _ | |
| 777 | Public Property RememberFormSize() As Boolean | 777 | Public Property RememberFormSize() As Boolean | |
| 778 | Get | 778 | Get | |
| 779 | Return Me._RememberFormSize | 779 | Return Me._RememberFormSize | |
| 780 | End Get | 780 | End Get | |
| 781 | Set(ByVal value As Boolean) | 781 | Set(ByVal value As Boolean) | |
| 782 | Me._RememberFormSize = value | 782 | Me._RememberFormSize = value | |
| 783 | End Set | 783 | End Set | |
| 784 | End Property | 784 | End Property | |
| 785 | 785 | |||
| 786 | ''' <summary> | 786 | ''' <summary> | |
| 787 | ''' Gets or sets a value that determines what business objects will be included when Add() is called | 787 | ''' Gets or sets a value that determines what business objects will be included when Add() is called | |
| 788 | ''' on the form. | 788 | ''' on the form. | |
| 789 | ''' </summary> | 789 | ''' </summary> | |
| 790 | ''' <value></value> | 790 | ''' <value></value> | |
| 791 | ''' <returns></returns> | 791 | ''' <returns></returns> | |
| 792 | ''' <remarks></remarks> | 792 | ''' <remarks></remarks> | |
| 793 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | 793 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | |
| 794 | Description("Determines what business objects will be included when Add() is called on the form.")> _ | 794 | Description("Determines what business objects will be included when Add() is called on the form.")> _ | |
| 795 | Public Property IncludeInFormAddType() As IncludeInFormTypeOptions | 795 | Public Property IncludeInFormAddType() As IncludeInFormTypeOptions | |
| 796 | Get | 796 | Get | |
| 797 | Return Me._IncludeInFormAddType | 797 | Return Me._IncludeInFormAddType | |
| 798 | End Get | 798 | End Get | |
| 799 | Set(ByVal value As IncludeInFormTypeOptions) | 799 | Set(ByVal value As IncludeInFormTypeOptions) | |
| 800 | Me._IncludeInFormAddType = value | 800 | Me._IncludeInFormAddType = value | |
| 801 | End Set | 801 | End Set | |
| 802 | End Property | 802 | End Property | |
| 803 | 803 | |||
| 804 | ''' <summary> | 804 | ''' <summary> | |
| 805 | ''' Gets or sets a value that determines what business objects will be included when Delete() is called | 805 | ''' Gets or sets a value that determines what business objects will be included when Delete() is called | |
| 806 | ''' on the form. | 806 | ''' on the form. | |
| 807 | ''' </summary> | 807 | ''' </summary> | |
| 808 | ''' <value></value> | 808 | ''' <value></value> | |
| 809 | ''' <returns></returns> | 809 | ''' <returns></returns> | |
| 810 | ''' <remarks></remarks> | 810 | ''' <remarks></remarks> | |
| 811 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | 811 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | |
| 812 | Description("Determines what business objects will be included when Delete() is called on the form.")> _ | 812 | Description("Determines what business objects will be included when Delete() is called on the form.")> _ | |
| 813 | Public Property IncludeInFormDeleteType() As IncludeInFormTypeOptions | 813 | Public Property IncludeInFormDeleteType() As IncludeInFormTypeOptions | |
| 814 | Get | 814 | Get | |
| 815 | Return Me._IncludeInFormDeleteType | 815 | Return Me._IncludeInFormDeleteType | |
| 816 | End Get | 816 | End Get | |
| 817 | Set(ByVal value As IncludeInFormTypeOptions) | 817 | Set(ByVal value As IncludeInFormTypeOptions) | |
| 818 | Me._IncludeInFormDeleteType = value | 818 | Me._IncludeInFormDeleteType = value | |
| 819 | End Set | 819 | End Set | |
| 820 | End Property | 820 | End Property | |
| 821 | 821 | |||
| 822 | ''' <summary> | 822 | ''' <summary> | |
| 823 | ''' Gets or sets a value that determines what business objects will be included when Edit() is called | 823 | ''' Gets or sets a value that determines what business objects will be included when Edit() is called | |
| 824 | ''' on the form. | 824 | ''' on the form. | |
| 825 | ''' </summary> | 825 | ''' </summary> | |
| 826 | ''' <value></value> | 826 | ''' <value></value> | |
| 827 | ''' <returns></returns> | 827 | ''' <returns></returns> | |
| 828 | ''' <remarks></remarks> | 828 | ''' <remarks></remarks> | |
| 829 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | 829 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | |
| 830 | Description("Determines what business objects will be included when Edit() is called on the form.")> _ | 830 | Description("Determines what business objects will be included when Edit() is called on the form.")> _ | |
| 831 | Public Property IncludeInFormEditType() As IncludeInFormTypeOptions | 831 | Public Property IncludeInFormEditType() As IncludeInFormTypeOptions | |
| 832 | Get | 832 | Get | |
| 833 | Return Me._IncludeInFormEditType | 833 | Return Me._IncludeInFormEditType | |
| 834 | End Get | 834 | End Get | |
| 835 | Set(ByVal value As IncludeInFormTypeOptions) | 835 | Set(ByVal value As IncludeInFormTypeOptions) | |
| 836 | Me._IncludeInFormEditType = value | 836 | Me._IncludeInFormEditType = value | |
| 837 | End Set | 837 | End Set | |
| 838 | End Property | 838 | End Property | |
| 839 | 839 | |||
| 840 | ''' <summary> | 840 | ''' <summary> | |
| 841 | ''' Gets or sets a value that determines what business objects will be included when a Navigate() is called | 841 | ''' Gets or sets a value that determines what business objects will be included when a Navigate() is called | |
| 842 | ''' on the form. | 842 | ''' on the form. | |
| 843 | ''' </summary> | 843 | ''' </summary> | |
| 844 | ''' <value></value> | 844 | ''' <value></value> | |
| 845 | ''' <returns></returns> | 845 | ''' <returns></returns> | |
| 846 | ''' <remarks></remarks> | 846 | ''' <remarks></remarks> | |
| 847 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | 847 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | |
| 848 | Description("Determines what business objects will be included when a Navigate() is called on the form.")> _ | 848 | Description("Determines what business objects will be included when a Navigate() is called on the form.")> _ | |
| 849 | Public Property IncludeInFormNavigateType() As IncludeInFormTypeOptions | 849 | Public Property IncludeInFormNavigateType() As IncludeInFormTypeOptions | |
| 850 | Get | 850 | Get | |
| 851 | Return Me._IncludeInFormNavigateType | 851 | Return Me._IncludeInFormNavigateType | |
| 852 | End Get | 852 | End Get | |
| 853 | Set(ByVal value As IncludeInFormTypeOptions) | 853 | Set(ByVal value As IncludeInFormTypeOptions) | |
| 854 | Me._IncludeInFormNavigateType = value | 854 | Me._IncludeInFormNavigateType = value | |
| 855 | End Set | 855 | End Set | |
| 856 | End Property | 856 | End Property | |
| 857 | 857 | |||
| 858 | ''' <summary> | 858 | ''' <summary> | |
| 859 | ''' Gets or sets a value that determines what business objects will be included when Save() is called | 859 | ''' Gets or sets a value that determines what business objects will be included when Save() is called | |
| 860 | ''' on the form. | 860 | ''' on the form. | |
| 861 | ''' </summary> | 861 | ''' </summary> | |
| 862 | ''' <value></value> | 862 | ''' <value></value> | |
| 863 | ''' <returns></returns> | 863 | ''' <returns></returns> | |
| 864 | ''' <remarks></remarks> | 864 | ''' <remarks></remarks> | |
| 865 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | 865 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | |
| 866 | Description("Determines what business objects will be included when Save() is called on the form.")> _ | 866 | Description("Determines what business objects will be included when Save() is called on the form.")> _ | |
| 867 | Public Property IncludeInFormSaveType() As IncludeInFormTypeOptions | 867 | Public Property IncludeInFormSaveType() As IncludeInFormTypeOptions | |
| 868 | Get | 868 | Get | |
| 869 | Return Me._IncludeInFormSaveType | 869 | Return Me._IncludeInFormSaveType | |
| 870 | End Get | 870 | End Get | |
| 871 | Set(ByVal value As IncludeInFormTypeOptions) | 871 | Set(ByVal value As IncludeInFormTypeOptions) | |
| 872 | Me._IncludeInFormSaveType = value | 872 | Me._IncludeInFormSaveType = value | |
| 873 | End Set | 873 | End Set | |
| 874 | End Property | 874 | End Property | |
| 875 | 875 | |||
| 876 | ''' <summary> | 876 | ''' <summary> | |
| 877 | ''' Gets or sets a value that determines what business objects will be included when Undo() is called | 877 | ''' Gets or sets a value that determines what business objects will be included when Undo() is called | |
| 878 | ''' on the form. | 878 | ''' on the form. | |
| 879 | ''' </summary> | 879 | ''' </summary> | |
| 880 | ''' <value></value> | 880 | ''' <value></value> | |
| 881 | ''' <returns></returns> | 881 | ''' <returns></returns> | |
| 882 | ''' <remarks></remarks> | 882 | ''' <remarks></remarks> | |
| 883 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | 883 | <Category(INCLUDE_IN_FORM_CATEGORY), _ | |
| 884 | Description("Determines what business objects will be included when Undo() is called on the form.")> _ | 884 | Description("Determines what business objects will be included when Undo() is called on the form.")> _ | |
| 885 | Public Property IncludeInFormUndoType() As IncludeInFormTypeOptions | 885 | Public Property IncludeInFormUndoType() As IncludeInFormTypeOptions | |
| 886 | Get | 886 | Get | |
| 887 | Return Me._IncludeInFormUndoType | 887 | Return Me._IncludeInFormUndoType | |
| 888 | End Get | 888 | End Get | |
| 889 | Set(ByVal value As IncludeInFormTypeOptions) | 889 | Set(ByVal value As IncludeInFormTypeOptions) | |
| 890 | Me._IncludeInFormUndoType = value | 890 | Me._IncludeInFormUndoType = value | |
| 891 | End Set | 891 | End Set | |
| 892 | End Property | 892 | End Property | |
| 893 | 893 | |||
| 894 | ''' <summary> | 894 | ''' <summary> | |
| 895 | ''' Determines whether or not the form will automatically attach an error provider to the fields that are bound to broken rules | 895 | ''' Determines whether or not the form will automatically attach an error provider to the fields that are bound to broken rules | |
| 896 | ''' </summary> | 896 | ''' </summary> | |
| 897 | ''' <value></value> | 897 | ''' <value></value> | |
| 898 | ''' <remarks></remarks> | 898 | ''' <remarks></remarks> | |
| 899 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("Determines whether or not the form will automatically attach an error provider to the fields that are bound to broken rules"), DefaultValue(True)> _ | 899 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("Determines whether or not the form will automatically attach an error provider to the fields that are bound to broken rules"), DefaultValue(True)> _ | |
| 900 | Public Property UseErrorProvider() As Boolean | 900 | Public Property UseErrorProvider() As Boolean | |
| 901 | Get | 901 | Get | |
| 902 | Return _UseErrorProvider | 902 | Return _UseErrorProvider | |
| 903 | End Get | 903 | End Get | |
| 904 | Set(ByVal value As Boolean) | 904 | Set(ByVal value As Boolean) | |
| 905 | _UseErrorProvider = value | 905 | _UseErrorProvider = value | |
| 906 | End Set | 906 | End Set | |
| 907 | End Property | 907 | End Property | |
| 908 | 908 | |||
| 909 | ''' <summary> | 909 | ''' <summary> | |
| 910 | ''' Gets or sets the permission key used to determine whether the current user has permission | 910 | ''' Gets or sets the permission key used to determine whether the current user has permission | |
| 911 | ''' to open this form. | 911 | ''' to open this form. | |
| 912 | ''' </summary> | 912 | ''' </summary> | |
| 913 | ''' <value></value> | 913 | ''' <value></value> | |
| 914 | ''' <returns></returns> | 914 | ''' <returns></returns> | |
| 915 | ''' <remarks></remarks> | 915 | ''' <remarks></remarks> | |
| 916 | <Category(CATEGORY_SECURITY), _ | 916 | <Category(CATEGORY_SECURITY), _ | |
| 917 | DefaultValue(""), _ | 917 | DefaultValue(""), _ | |
| 918 | Description("The permission key used to determine whether the current user has permission to open this form."), _ | 918 | Description("The permission key used to determine whether the current user has permission to open this form."), _ | |
| 919 | Editor(Constants.TE_SecurityKeyTypeEditor, GetType(UITypeEditor))> _ | 919 | Editor(Constants.TE_SecurityKeyTypeEditor, GetType(UITypeEditor))> _ | |
| 920 | Public Property ViewSecurityKey() As String | 920 | Public Property ViewSecurityKey() As String | |
| 921 | Get | 921 | Get | |
| 922 | Return _ViewSecurityKey | 922 | Return _ViewSecurityKey | |
| 923 | End Get | 923 | End Get | |
| 924 | Set(ByVal value As String) | 924 | Set(ByVal value As String) | |
| 925 | _ViewSecurityKey = value | 925 | _ViewSecurityKey = value | |
| 926 | End Set | 926 | End Set | |
| 927 | End Property | 927 | End Property | |
| 928 | 928 | |||
| 929 | ''' <summary> | 929 | ''' <summary> | |
| 930 | ''' The icon used for the error provider. | 930 | ''' The icon used for the error provider. | |
| 931 | ''' </summary> | 931 | ''' </summary> | |
| 932 | ''' <value></value> | 932 | ''' <value></value> | |
| 933 | ''' <remarks></remarks> | 933 | ''' <remarks></remarks> | |
| 934 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The icon the error provider uses to indicate an error on a control.")> _ | 934 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The icon the error provider uses to indicate an error on a control.")> _ | |
| 935 | Public Property ErrorProviderIcon() As Icon | 935 | Public Property ErrorProviderIcon() As Icon | |
| 936 | Get | 936 | Get | |
| 937 | Return _ErrorProviderIcon | 937 | Return _ErrorProviderIcon | |
| 938 | End Get | 938 | End Get | |
| 939 | Set(ByVal value As Icon) | 939 | Set(ByVal value As Icon) | |
| 940 | _ErrorProviderIcon = value | 940 | _ErrorProviderIcon = value | |
| 941 | End Set | 941 | End Set | |
| 942 | End Property | 942 | End Property | |
| 943 | 943 | |||
| 944 | ''' <summary> | 944 | ''' <summary> | |
| 945 | ''' The alignment for the icon in relation to the control | 945 | ''' The alignment for the icon in relation to the control | |
| 946 | ''' </summary> | 946 | ''' </summary> | |
| 947 | ''' <value></value> | 947 | ''' <value></value> | |
| 948 | ''' <remarks></remarks> | 948 | ''' <remarks></remarks> | |
| 949 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The alignment used for the error provider icon in relation to a control."), DefaultValue(ErrorIconAlignment.MiddleRight)> _ | 949 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The alignment used for the error provider icon in relation to a control."), DefaultValue(ErrorIconAlignment.MiddleRight)> _ | |
| 950 | Public Property ErrorProviderIconAlignment() As ErrorIconAlignment | 950 | Public Property ErrorProviderIconAlignment() As ErrorIconAlignment | |
| 951 | Get | 951 | Get | |
| 952 | Return _ErrorProviderIconAlignment | 952 | Return _ErrorProviderIconAlignment | |
| 953 | End Get | 953 | End Get | |
| 954 | Set(ByVal value As ErrorIconAlignment) | 954 | Set(ByVal value As ErrorIconAlignment) | |
| 955 | _ErrorProviderIconAlignment = value | 955 | _ErrorProviderIconAlignment = value | |
| 956 | End Set | 956 | End Set | |
| 957 | End Property | 957 | End Property | |
| 958 | 958 | |||
| 959 | ''' <summary> | 959 | ''' <summary> | |
| 960 | ''' The rate at which the error provider icon will blink (in milliseconds) | 960 | ''' The rate at which the error provider icon will blink (in milliseconds) | |
| 961 | ''' </summary> | 961 | ''' </summary> | |
| 962 | ''' <value></value> | 962 | ''' <value></value> | |
| 963 | ''' <remarks></remarks> | 963 | ''' <remarks></remarks> | |
| 964 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The rate at which the error provider icon will blink (in milliseconds)."), DefaultValue(150)> _ | 964 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The rate at which the error provider icon will blink (in milliseconds)."), DefaultValue(150)> _ | |
| 965 | Public Property ErrorIconBlinkRate() As Integer | 965 | Public Property ErrorIconBlinkRate() As Integer | |
| 966 | Get | 966 | Get | |
| 967 | Return _ErrorProviderBlinkRate | 967 | Return _ErrorProviderBlinkRate | |
| 968 | End Get | 968 | End Get | |
| 969 | Set(ByVal value As Integer) | 969 | Set(ByVal value As Integer) | |
| 970 | _ErrorProviderBlinkRate = value | 970 | _ErrorProviderBlinkRate = value | |
| 971 | End Set | 971 | End Set | |
| 972 | End Property | 972 | End Property | |
| 973 | 973 | |||
| 974 | ''' <summary> | 974 | ''' <summary> | |
| 975 | ''' The blink style used for the error provider | 975 | ''' The blink style used for the error provider | |
| 976 | ''' </summary> | 976 | ''' </summary> | |
| 977 | ''' <value></value> | 977 | ''' <value></value> | |
| 978 | ''' <remarks></remarks> | 978 | ''' <remarks></remarks> | |
| 979 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The blink style used for the error provider."), DefaultValue(ErrorBlinkStyle.BlinkIfDifferentError)> _ | 979 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The blink style used for the error provider."), DefaultValue(ErrorBlinkStyle.BlinkIfDifferentError)> _ | |
| 980 | Public Property ErrorProviderBlinkStyle() As ErrorBlinkStyle | 980 | Public Property ErrorProviderBlinkStyle() As ErrorBlinkStyle | |
| 981 | Get | 981 | Get | |
| 982 | Return _ErrorProviderBlinkStyle | 982 | Return _ErrorProviderBlinkStyle | |
| 983 | End Get | 983 | End Get | |
| 984 | Set(ByVal value As ErrorBlinkStyle) | 984 | Set(ByVal value As ErrorBlinkStyle) | |
| 985 | _ErrorProviderBlinkStyle = value | 985 | _ErrorProviderBlinkStyle = value | |
| 986 | End Set | 986 | End Set | |
| 987 | End Property | 987 | End Property | |
| 988 | 988 | |||
| 989 | ''' <summary> | 989 | ''' <summary> | |
| 990 | ''' The padding used when drawing the icon next to a control for the error provider. | 990 | ''' The padding used when drawing the icon next to a control for the error provider. | |
| 991 | ''' </summary> | 991 | ''' </summary> | |
| 992 | ''' <value></value> | 992 | ''' <value></value> | |
| 993 | ''' <remarks></remarks> | 993 | ''' <remarks></remarks> | |
| 994 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The padding used when drawing the icon next to a control for the error provider."), DefaultValue(-9)> _ | 994 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), Description("The padding used when drawing the icon next to a control for the error provider."), DefaultValue(-9)> _ | |
| 995 | Public Property ErrorProviderIconPadding() As Integer | 995 | Public Property ErrorProviderIconPadding() As Integer | |
| 996 | Get | 996 | Get | |
| 997 | Return _ErrorProviderIconPadding | 997 | Return _ErrorProviderIconPadding | |
| 998 | End Get | 998 | End Get | |
| 999 | Set(ByVal value As Integer) | 999 | Set(ByVal value As Integer) | |
| 1000 | _ErrorProviderIconPadding = value | 1000 | _ErrorProviderIconPadding = value | |
| 1001 | End Set | 1001 | End Set | |
| 1002 | End Property | 1002 | End Property | |
| 1003 | 1003 | |||
| 1004 | ''' <summary> | 1004 | ''' <summary> | |
| 1005 | ''' The ErrorProvider description assigned to required fields | 1005 | ''' The ErrorProvider description assigned to required fields | |
| 1006 | ''' </summary> | 1006 | ''' </summary> | |
| 1007 | ''' <value></value> | 1007 | ''' <value></value> | |
| 1008 | ''' <remarks></remarks> | 1008 | ''' <remarks></remarks> | |
| 1009 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), _ | 1009 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), _ | |
| 1010 | Description("The ErrorProvider description assigned to required fields")> _ | 1010 | Description("The ErrorProvider description assigned to required fields")> _ | |
| 1011 | Public Property ErrorProviderRequiredFieldDesc() As String | 1011 | Public Property ErrorProviderRequiredFieldDesc() As String | |
| 1012 | Get | 1012 | Get | |
| 1013 | Return _ErrorProviderRequiredFieldDesc | 1013 | Return _ErrorProviderRequiredFieldDesc | |
| 1014 | End Get | 1014 | End Get | |
| 1015 | Set(ByVal value As String) | 1015 | Set(ByVal value As String) | |
| 1016 | _ErrorProviderRequiredFieldDescText = value | 1016 | _ErrorProviderRequiredFieldDescText = value | |
| 1017 | End Set | 1017 | End Set | |
| 1018 | End Property | 1018 | End Property | |
| 1019 | 1019 | |||
| 1020 | ''' <summary> | 1020 | ''' <summary> | |
| 1021 | ''' The key used to retrieve the ErroProviderRequiredFieldsDesc from the localization database (This property overrides the ErrorProviderRequiredFieldsDesc property.) | 1021 | ''' The key used to retrieve the ErroProviderRequiredFieldsDesc from the localization database (This property overrides the ErrorProviderRequiredFieldsDesc property.) | |
| 1022 | ''' </summary> | 1022 | ''' </summary> | |
| 1023 | ''' <value></value> | 1023 | ''' <value></value> | |
| 1024 | ''' <remarks></remarks> | 1024 | ''' <remarks></remarks> | |
| 1025 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), DefaultValue(""), _ | 1025 | <Category(FORM_ERRORPROVIDER_CATEGORY), Browsable(True), DefaultValue(""), _ | |
| 1026 | Description("The key used to retrieve the ErroProviderRequiredFieldsDesc from the localization database (This property overrides the ErrorProviderRequiredFieldsDesc property.)")> _ | 1026 | Description("The key used to retrieve the ErroProviderRequiredFieldsDesc from the localization database (This property overrides the ErrorProviderRequiredFieldsDesc property.)")> _ | |
| 1027 | Public Property ErrorProviderRequiredFieldDescKey() As String | 1027 | Public Property ErrorProviderRequiredFieldDescKey() As String | |
| 1028 | Get | 1028 | Get | |
| 1029 | Return _ErrorProviderRequiredFieldDescKey | 1029 | Return _ErrorProviderRequiredFieldDescKey | |
| 1030 | End Get | 1030 | End Get | |
| 1031 | Set(ByVal value As String) | 1031 | Set(ByVal value As String) | |
| 1032 | _ErrorProviderRequiredFieldDescKey = value | 1032 | _ErrorProviderRequiredFieldDescKey = value | |
| 1033 | End Set | 1033 | End Set | |
| 1034 | End Property | 1034 | End Property | |
| 1035 | 1035 | |||
| 1036 | ''' <summary> | 1036 | ''' <summary> | |
| 1037 | ''' Determines if the form is a child form. When set to true, the business layer knows how to interact with form level events. For example, setting this property and calling the CheckRulesOnRow() method on a business object will allow the error window to display. | 1037 | ''' Determines if the form is a child form. When set to true, the business layer knows how to interact with form level events. For example, setting this property and calling the CheckRulesOnRow() method on a business object will allow the error window to display. | |
| 1038 | ''' </summary> | 1038 | ''' </summary> | |
| 1039 | ''' <value></value> | 1039 | ''' <value></value> | |
| 1040 | ''' <remarks></remarks> | 1040 | ''' <remarks></remarks> | |
| 1041 | <Category(FORM_FRAMEWORK_CATEGORY), Description("Determines if the form is a child form. When set to true, the business layer knows how to interact with form level events. For example, setting this property and calling the CheckRulesOnRow() method on a business object will allow the error window to display."), DefaultValue(False)> _ | 1041 | <Category(FORM_FRAMEWORK_CATEGORY), Description("Determines if the form is a child form. When set to true, the business layer knows how to interact with form level events. For example, setting this property and calling the CheckRulesOnRow() method on a business object will allow the error window to display."), DefaultValue(False)> _ | |
| 1042 | Public Property IsChildForm() As Boolean | 1042 | Public Property IsChildForm() As Boolean | |
| 1043 | Get | 1043 | Get | |
| 1044 | Return _IsChildForm | 1044 | Return _IsChildForm | |
| 1045 | End Get | 1045 | End Get | |
| 1046 | Set(ByVal value As Boolean) | 1046 | Set(ByVal value As Boolean) | |
| 1047 | _IsChildForm = value | 1047 | _IsChildForm = value | |
| 1048 | End Set | 1048 | End Set | |
| 1049 | End Property | 1049 | End Property | |
| 1050 | 1050 | |||
| 1051 | ''' <summary> | 1051 | ''' <summary> | |
| 1052 | ''' Determines if the form is currently in design mode | 1052 | ''' Determines if the form is currently in design mode | |
| 1053 | ''' </summary> | 1053 | ''' </summary> | |
| 1054 | ''' <value></value> | 1054 | ''' <value></value> | |
| 1055 | ''' <remarks></remarks> | 1055 | ''' <remarks></remarks> | |
| 1056 | <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ | 1056 | <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ | |
| 1057 | Public ReadOnly Property InDesignMode() As Boolean | 1057 | Public ReadOnly Property InDesignMode() As Boolean | |
| 1058 | Get | 1058 | Get | |
| 1059 | Return Me.DesignMode | 1059 | Return Me.DesignMode | |
| 1060 | End Get | 1060 | End Get | |
| 1061 | End Property | 1061 | End Property | |
| 1062 | 1062 | |||
| 1063 | ''' <summary> | 1063 | ''' <summary> | |
| 1064 | ''' Determines whether or not the form will automatically show an error message when an exception is encountered | 1064 | ''' Determines whether or not the form will automatically show an error message when an exception is encountered | |
| 1065 | ''' while trying to save the business objects on the form | 1065 | ''' while trying to save the business objects on the form | |
| 1066 | ''' </summary> | 1066 | ''' </summary> | |
| 1067 | ''' <value></value> | 1067 | ''' <value></value> | |
| 1068 | ''' <remarks></remarks> | 1068 | ''' <remarks></remarks> | |
| 1069 | <Category(FORM_UIAUTOMATION_CATEGORY), Description("Determines whether or not the form will automatically show an error message when an exception is encountered while trying to save the business objects on the form."), DefaultValue(True)> _ | 1069 | <Category(FORM_UIAUTOMATION_CATEGORY), Description("Determines whether or not the form will automatically show an error message when an exception is encountered while trying to save the business objects on the form."), DefaultValue(True)> _ | |
| 1070 | Public Property AutoShowSavingErrors() As Boolean | 1070 | Public Property AutoShowSavingErrors() As Boolean | |
| 1071 | Get | 1071 | Get | |
| 1072 | Return _AutoShowSavingErrors | 1072 | Return _AutoShowSavingErrors | |
| 1073 | End Get | 1073 | End Get | |
| 1074 | Set(ByVal value As Boolean) | 1074 | Set(ByVal value As Boolean) | |
| 1075 | _AutoShowSavingErrors = value | 1075 | _AutoShowSavingErrors = value | |
| 1076 | End Set | 1076 | End Set | |
| 1077 | End Property | 1077 | End Property | |
| 1078 | 1078 | |||
| 1079 | ''' <summary> | 1079 | ''' <summary> | |
| 1080 | ''' Gets or sets a value that determines whether the form should automatically show messages due | 1080 | ''' Gets or sets a value that determines whether the form should automatically show messages due | |
| 1081 | ''' to security being denied to the current user. | 1081 | ''' to security being denied to the current user. | |
| 1082 | ''' </summary> | 1082 | ''' </summary> | |
| 1083 | ''' <value></value> | 1083 | ''' <value></value> | |
| 1084 | ''' <returns></returns> | 1084 | ''' <returns></returns> | |
| 1085 | ''' <remarks></remarks> | 1085 | ''' <remarks></remarks> | |
| 1086 | <Category(Business.FORM_UIAUTOMATION_CATEGORY), _ | 1086 | <Category(Business.FORM_UIAUTOMATION_CATEGORY), _ | |
| 1087 | DefaultValue(True), _ | 1087 | DefaultValue(True), _ | |
| 1088 | Description("Determines whether the form should automatically show messages due to security being denied to the current user.")> _ | 1088 | Description("Determines whether the form should automatically show messages due to security being denied to the current user.")> _ | |
| 1089 | Public Property AutoShowSecurityDenied() As Boolean | 1089 | Public Property AutoShowSecurityDenied() As Boolean | |
| 1090 | Get | 1090 | Get | |
| 1091 | Return Me._AutoShowSecurityDenied | 1091 | Return Me._AutoShowSecurityDenied | |
| 1092 | End Get | 1092 | End Get | |
| 1093 | Set(ByVal value As Boolean) | 1093 | Set(ByVal value As Boolean) | |
| 1094 | Me._AutoShowSecurityDenied = value | 1094 | Me._AutoShowSecurityDenied = value | |
| 1095 | End Set | 1095 | End Set | |
| 1096 | End Property | 1096 | End Property | |
| 1097 | 1097 | |||
| 1098 | ''' <summary> | 1098 | ''' <summary> | |
| 1099 | ''' Determines whether or not the form will automatically handle soft collisions by | 1099 | ''' Determines whether or not the form will automatically handle soft collisions by | |
| 1100 | ''' prompting the user to select the appropriate values. | 1100 | ''' prompting the user to select the appropriate values. | |
| 1101 | ''' </summary> | 1101 | ''' </summary> | |
| 1102 | ''' <value></value> | 1102 | ''' <value></value> | |
| 1103 | ''' <remarks></remarks> | 1103 | ''' <remarks></remarks> | |
| 1104 | <Category(FORM_UIAUTOMATION_CATEGORY), Description("Determines whether or not the form will automatically handle soft collisions by prompting the user to select the appropriate values."), DefaultValue(True)> _ | 1104 | <Category(FORM_UIAUTOMATION_CATEGORY), Description("Determines whether or not the form will automatically handle soft collisions by prompting the user to select the appropriate values."), DefaultValue(True)> _ | |
| 1105 | Public Property AutoHandleCollisions() As Boolean | 1105 | Public Property AutoHandleCollisions() As Boolean | |
| 1106 | Get | 1106 | Get | |
| 1107 | Return _AutoHandleCollisions | 1107 | Return _AutoHandleCollisions | |
| 1108 | End Get | 1108 | End Get | |
| 1109 | Set(ByVal value As Boolean) | 1109 | Set(ByVal value As Boolean) | |
| 1110 | _AutoHandleCollisions = value | 1110 | _AutoHandleCollisions = value | |
| 1111 | End Set | 1111 | End Set | |
| 1112 | End Property | 1112 | End Property | |
| 1113 | 1113 | |||
| 1114 | ''' <summary> | 1114 | ''' <summary> | |
| 1115 | ''' Determines if a generic message will be displayed for a deletion confirmation rather than | 1115 | ''' Determines if a generic message will be displayed for a deletion confirmation rather than | |
| 1116 | ''' a user specified message captured in the BeforeDelete Event. | 1116 | ''' a user specified message captured in the BeforeDelete Event. | |
| 1117 | ''' </summary> | 1117 | ''' </summary> | |
| 1118 | ''' <value></value> | 1118 | ''' <value></value> | |
| 1119 | ''' <remarks></remarks> | 1119 | ''' <remarks></remarks> | |
| 1120 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(True), _ | 1120 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(True), _ | |
| 1121 | Description("Determines if a generic message will be displayed for a deletion confirmation rather than a user specified message captured in the BeforeDelete Event.")> _ | 1121 | Description("Determines if a generic message will be displayed for a deletion confirmation rather than a user specified message captured in the BeforeDelete Event.")> _ | |
| 1122 | Public Property AutoShowDeleteConfirmation() As Boolean | 1122 | Public Property AutoShowDeleteConfirmation() As Boolean | |
| 1123 | Get | 1123 | Get | |
| 1124 | Return _AutoShowDeleteConfirmation | 1124 | Return _AutoShowDeleteConfirmation | |
| 1125 | End Get | 1125 | End Get | |
| 1126 | Set(ByVal value As Boolean) | 1126 | Set(ByVal value As Boolean) | |
| 1127 | _AutoShowDeleteConfirmation = value | 1127 | _AutoShowDeleteConfirmation = value | |
| 1128 | End Set | 1128 | End Set | |
| 1129 | End Property | 1129 | End Property | |
| 1130 | 1130 | |||
| 1131 | ''' <summary> | 1131 | ''' <summary> | |
| 1132 | ''' The title for the delete confirmation when AutoShowDeleteConfirmation is set to True. | 1132 | ''' The title for the delete confirmation when AutoShowDeleteConfirmation is set to True. | |
| 1133 | ''' </summary> | 1133 | ''' </summary> | |
| 1134 | ''' <value></value> | 1134 | ''' <value></value> | |
| 1135 | ''' <remarks></remarks> | 1135 | ''' <remarks></remarks> | |
| 1136 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | 1136 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | |
| 1137 | Description("The title for the delete confirmation when AutoShowDeleteConfirmation is set to True.")> _ | 1137 | Description("The title for the delete confirmation when AutoShowDeleteConfirmation is set to True.")> _ | |
| 1138 | Public Property AutoDeleteTitle() As String | 1138 | Public Property AutoDeleteTitle() As String | |
| 1139 | Get | 1139 | Get | |
| 1140 | Return _AutoDeleteTitle | 1140 | Return _AutoDeleteTitle | |
| 1141 | End Get | 1141 | End Get | |
| 1142 | Set(ByVal value As String) | 1142 | Set(ByVal value As String) | |
| 1143 | _AutoDeleteTitleText = value | 1143 | _AutoDeleteTitleText = value | |
| 1144 | End Set | 1144 | End Set | |
| 1145 | End Property | 1145 | End Property | |
| 1146 | 1146 | |||
| 1147 | ''' <summary> | 1147 | ''' <summary> | |
| 1148 | ''' The key used to pull the title for the auto delete title from the localization database | 1148 | ''' The key used to pull the title for the auto delete title from the localization database | |
| 1149 | ''' (This property will override the AutoDeleteTitle property.) | 1149 | ''' (This property will override the AutoDeleteTitle property.) | |
| 1150 | ''' </summary> | 1150 | ''' </summary> | |
| 1151 | ''' <remarks></remarks> | 1151 | ''' <remarks></remarks> | |
| 1152 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | 1152 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | |
| 1153 | Description("The key used to pull the title for the auto delete title from the localization database (This property will override the AutoDeleteTitle property.)")> _ | 1153 | Description("The key used to pull the title for the auto delete title from the localization database (This property will override the AutoDeleteTitle property.)")> _ | |
| 1154 | Public Property AutoDeleteTitleKey() As String | 1154 | Public Property AutoDeleteTitleKey() As String | |
| 1155 | Get | 1155 | Get | |
| 1156 | Return _AutoDeleteTitleKey | 1156 | Return _AutoDeleteTitleKey | |
| 1157 | End Get | 1157 | End Get | |
| 1158 | Set(ByVal value As String) | 1158 | Set(ByVal value As String) | |
| 1159 | _AutoDeleteTitleKey = value | 1159 | _AutoDeleteTitleKey = value | |
| 1160 | End Set | 1160 | End Set | |
| 1161 | End Property | 1161 | End Property | |
| 1162 | 1162 | |||
| 1163 | ''' <summary> | 1163 | ''' <summary> | |
| 1164 | ''' The message body for the delete confirmation when AutoShowDeleteConfirmation is set to True. | 1164 | ''' The message body for the delete confirmation when AutoShowDeleteConfirmation is set to True. | |
| 1165 | ''' </summary> | 1165 | ''' </summary> | |
| 1166 | ''' <value></value> | 1166 | ''' <value></value> | |
| 1167 | ''' <remarks></remarks> | 1167 | ''' <remarks></remarks> | |
| 1168 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | 1168 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | |
| 1169 | Description("The message body for the delete confirmation when AutoShowDeleteConfirmation is set to True.")> _ | 1169 | Description("The message body for the delete confirmation when AutoShowDeleteConfirmation is set to True.")> _ | |
| 1170 | Public Property AutoDeleteMessage() As String | 1170 | Public Property AutoDeleteMessage() As String | |
| 1171 | Get | 1171 | Get | |
| 1172 | Return _AutoDeleteMessage | 1172 | Return _AutoDeleteMessage | |
| 1173 | End Get | 1173 | End Get | |
| 1174 | Set(ByVal value As String) | 1174 | Set(ByVal value As String) | |
| 1175 | _AutoDeleteMessageText = value | 1175 | _AutoDeleteMessageText = value | |
| 1176 | End Set | 1176 | End Set | |
| 1177 | End Property | 1177 | End Property | |
| 1178 | 1178 | |||
| 1179 | ''' <summary> | 1179 | ''' <summary> | |
| 1180 | ''' The key used to pull the title for the auto delete message from the localization database (This will override the AutoDeleteMessage property.) | 1180 | ''' The key used to pull the title for the auto delete message from the localization database (This will override the AutoDeleteMessage property.) | |
| 1181 | ''' </summary> | 1181 | ''' </summary> | |
| 1182 | ''' <value></value> | 1182 | ''' <value></value> | |
| 1183 | ''' <remarks></remarks> | 1183 | ''' <remarks></remarks> | |
| 1184 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | 1184 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | |
| 1185 | Description("The key used to pull the title for the auto delete message from the localization database (This will override the AutoDeleteMessage property.)")> _ | 1185 | Description("The key used to pull the title for the auto delete message from the localization database (This will override the AutoDeleteMessage property.)")> _ | |
| 1186 | Public Property AutoDeleteMessageKey() As String | 1186 | Public Property AutoDeleteMessageKey() As String | |
| 1187 | Get | 1187 | Get | |
| 1188 | Return _AutoDeleteMessageKey | 1188 | Return _AutoDeleteMessageKey | |
| 1189 | End Get | 1189 | End Get | |
| 1190 | Set(ByVal value As String) | 1190 | Set(ByVal value As String) | |
| 1191 | _AutoDeleteMessageKey = value | 1191 | _AutoDeleteMessageKey = value | |
| 1192 | End Set | 1192 | End Set | |
| 1193 | End Property | 1193 | End Property | |
| 1194 | 1194 | |||
| 1195 | ''' <summary> | 1195 | ''' <summary> | |
| 1196 | ''' Determines if a generic message will be displayed if changes exist that need to be saved back | 1196 | ''' Determines if a generic message will be displayed if changes exist that need to be saved back | |
| 1197 | ''' to the server rather than a user specified message captured in the BeforeDelete Event. | 1197 | ''' to the server rather than a user specified message captured in the BeforeDelete Event. | |
| 1198 | ''' </summary> | 1198 | ''' </summary> | |
| 1199 | ''' <value></value> | 1199 | ''' <value></value> | |
| 1200 | ''' <remarks></remarks> | 1200 | ''' <remarks></remarks> | |
| 1201 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(True), _ | 1201 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(True), _ | |
| 1202 | Description("Determines if a generic message will be displayed if changes exist that need to be saved back to the server rather than a user specified message captured in the BeforeDelete Event.")> _ | 1202 | Description("Determines if a generic message will be displayed if changes exist that need to be saved back to the server rather than a user specified message captured in the BeforeDelete Event.")> _ | |
| 1203 | Public Property AutoShowSaveChangesMessage() As Boolean | 1203 | Public Property AutoShowSaveChangesMessage() As Boolean | |
| 1204 | Get | 1204 | Get | |
| 1205 | Return _AutoShowSaveChangesMessage | 1205 | Return _AutoShowSaveChangesMessage | |
| 1206 | End Get | 1206 | End Get | |
| 1207 | Set(ByVal value As Boolean) | 1207 | Set(ByVal value As Boolean) | |
| 1208 | _AutoShowSaveChangesMessage = value | 1208 | _AutoShowSaveChangesMessage = value | |
| 1209 | End Set | 1209 | End Set | |
| 1210 | End Property | 1210 | End Property | |
| 1211 | 1211 | |||
| 1212 | ''' <summary> | 1212 | ''' <summary> | |
| 1213 | ''' The title for the save changes message if AutoShowSaveChangesMessage is set to true. | 1213 | ''' The title for the save changes message if AutoShowSaveChangesMessage is set to true. | |
| 1214 | ''' </summary> | 1214 | ''' </summary> | |
| 1215 | ''' <value></value> | 1215 | ''' <value></value> | |
| 1216 | ''' <remarks></remarks> | 1216 | ''' <remarks></remarks> | |
| 1217 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | 1217 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | |
| 1218 | Description("The title for the save changes message if AutoShowSaveChangesMessage is set to true.")> _ | 1218 | Description("The title for the save changes message if AutoShowSaveChangesMessage is set to true.")> _ | |
| 1219 | Public Property AutoSaveChangesTitle() As String | 1219 | Public Property AutoSaveChangesTitle() As String | |
| 1220 | Get | 1220 | Get | |
| 1221 | Return _AutoSaveChangesTitle | 1221 | Return _AutoSaveChangesTitle | |
| 1222 | End Get | 1222 | End Get | |
| 1223 | Set(ByVal value As String) | 1223 | Set(ByVal value As String) | |
| 1224 | _AutoSaveChangesTitleText = value | 1224 | _AutoSaveChangesTitleText = value | |
| 1225 | End Set | 1225 | End Set | |
| 1226 | End Property | 1226 | End Property | |
| 1227 | 1227 | |||
| 1228 | ''' <summary> | 1228 | ''' <summary> | |
| 1229 | ''' The key used to retrieve the AutoSaveChangesTitle from the localization database | 1229 | ''' The key used to retrieve the AutoSaveChangesTitle from the localization database | |
| 1230 | ''' (This property overrides the AutoSaveChangesTitle property.) | 1230 | ''' (This property overrides the AutoSaveChangesTitle property.) | |
| 1231 | ''' </summary> | 1231 | ''' </summary> | |
| 1232 | ''' <value></value> | 1232 | ''' <value></value> | |
| 1233 | ''' <remarks></remarks> | 1233 | ''' <remarks></remarks> | |
| 1234 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | 1234 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | |
| 1235 | Description("The key used to retrieve the AutoSaveChangesTitle from the localization database (This property overrides the AutoSaveChangesTitle property.)")> _ | 1235 | Description("The key used to retrieve the AutoSaveChangesTitle from the localization database (This property overrides the AutoSaveChangesTitle property.)")> _ | |
| 1236 | Public Property AutoSaveChangesTitleKey() As String | 1236 | Public Property AutoSaveChangesTitleKey() As String | |
| 1237 | Get | 1237 | Get | |
| 1238 | Return _AutoSaveChangesTitleKey | 1238 | Return _AutoSaveChangesTitleKey | |
| 1239 | End Get | 1239 | End Get | |
| 1240 | Set(ByVal value As String) | 1240 | Set(ByVal value As String) | |
| 1241 | _AutoSaveChangesTitleKey = value | 1241 | _AutoSaveChangesTitleKey = value | |
| 1242 | End Set | 1242 | End Set | |
| 1243 | End Property | 1243 | End Property | |
| 1244 | 1244 | |||
| 1245 | ''' <summary> | 1245 | ''' <summary> | |
| 1246 | ''' The message body for the save changes message if the AutoShowSaveChangesMessage is set to true. | 1246 | ''' The message body for the save changes message if the AutoShowSaveChangesMessage is set to true. | |
| 1247 | ''' </summary> | 1247 | ''' </summary> | |
| 1248 | ''' <value></value> | 1248 | ''' <value></value> | |
| 1249 | ''' <remarks></remarks> | 1249 | ''' <remarks></remarks> | |
| 1250 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | 1250 | <Category(FORM_UIAUTOMATION_CATEGORY), _ | |
| 1251 | Description("The message body for the save changes message if the AutoShowSaveChangesMessage is set to true.")> _ | 1251 | Description("The message body for the save changes message if the AutoShowSaveChangesMessage is set to true.")> _ | |
| 1252 | Public Property AutoSaveChangesMessage() As String | 1252 | Public Property AutoSaveChangesMessage() As String | |
| 1253 | Get | 1253 | Get | |
| 1254 | Return _AutoSaveChangesMessage | 1254 | Return _AutoSaveChangesMessage | |
| 1255 | End Get | 1255 | End Get | |
| 1256 | Set(ByVal value As String) | 1256 | Set(ByVal value As String) | |
| 1257 | _AutoSaveChangesMessageText = value | 1257 | _AutoSaveChangesMessageText = value | |
| 1258 | End Set | 1258 | End Set | |
| 1259 | End Property | 1259 | End Property | |
| 1260 | 1260 | |||
| 1261 | ''' <summary> | 1261 | ''' <summary> | |
| 1262 | ''' The key used to retrieve the AutoSaveChangesMessage from the localization database | 1262 | ''' The key used to retrieve the AutoSaveChangesMessage from the localization database | |
| 1263 | ''' (This property overrides the AutoSaveChangesMessage property.) | 1263 | ''' (This property overrides the AutoSaveChangesMessage property.) | |
| 1264 | ''' </summary> | 1264 | ''' </summary> | |
| 1265 | ''' <value></value> | 1265 | ''' <value></value> | |
| 1266 | ''' <remarks></remarks> | 1266 | ''' <remarks></remarks> | |
| 1267 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | 1267 | <Category(FORM_UIAUTOMATION_CATEGORY), DefaultValue(""), _ | |
| 1268 | Description("The key used to retrieve the AutoSaveChangesMessage from the localization database (This property overrides the AutoSaveChangesMessage property.)")> _ | 1268 | Description("The key used to retrieve the AutoSaveChangesMessage from the localization database (This property overrides the AutoSaveChangesMessage property.)")> _ | |
| 1269 | Public Property AutoSaveChangesMessageKey() As String | 1269 | Public Property AutoSaveChangesMessageKey() As String | |
| 1270 | Get | 1270 | Get | |
| 1271 | Return _AutoSaveChangesMessageKey | 1271 | Return _AutoSaveChangesMessageKey | |
| 1272 | End Get | 1272 | End Get | |
| 1273 | Set(ByVal value As String) | 1273 | Set(ByVal value As String) | |
| 1274 | _AutoSaveChangesMessageKey = value | 1274 | _AutoSaveChangesMessageKey = value | |
| 1275 | End Set | 1275 | End Set | |
| 1276 | End Property | 1276 | End Property | |
| 1277 | 1277 | |||
| 1278 | ''' <summary> | 1278 | ''' <summary> | |
| 1279 | ''' A collection that is dynamically built by the business layer when a business object | 1279 | ''' A collection that is dynamically built by the business layer when a business object | |
| 1280 | ''' is dropped on a form and instantiated | 1280 | ''' is dropped on a form and instantiated | |
| 1281 | ''' </summary> | 1281 | ''' </summary> | |
| 1282 | ''' <value></value> | 1282 | ''' <value></value> | |
| 1283 | ''' <remarks></remarks> | 1283 | ''' <remarks></remarks> | |
| 1284 | <Browsable(False), Description("Collection of business objects that reside on the form."), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ | 1284 | <Browsable(False), Description("Collection of business objects that reside on the form."), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ | |
| 1285 | Public ReadOnly Property BusinessObjects() As BusinessObjectCollection | 1285 | Public ReadOnly Property BusinessObjects() As BusinessObjectCollection | |
| 1286 | Get | 1286 | Get | |
| 1287 | Return _BusinessObjects | 1287 | Return _BusinessObjects | |
| 1288 | End Get | 1288 | End Get | |
| 1289 | End Property | 1289 | End Property | |
| 1290 | 1290 | |||
| 1291 | ''' <summary> | 1291 | ''' <summary> | |
| 1292 | ''' The primary business object for the form. This will allow the form to know which | 1292 | ''' The primary business object for the form. This will allow the form to know which | |
| 1293 | ''' business object should be referenced when creating new records through the framework, etc. | 1293 | ''' business object should be referenced when creating new records through the framework, etc. | |
| 1294 | ''' </summary> | 1294 | ''' </summary> | |
| 1295 | ''' <value></value> | 1295 | ''' <value></value> | |
| 1296 | ''' <remarks></remarks> | 1296 | ''' <remarks></remarks> | |
| 1297 | <Category(FORM_FRAMEWORK_CATEGORY), Description("The primary business object for the form.")> _ | 1297 | <Category(FORM_FRAMEWORK_CATEGORY), Description("The primary business object for the form.")> _ | |
| 1298 | Public Property PrimaryBusinessObject() As BusinessLayer | 1298 | Public Property PrimaryBusinessObject() As BusinessLayer | |
| 1299 | Get | 1299 | Get | |
| 1300 | Return _PrimaryBusinessObject | 1300 | Return _PrimaryBusinessObject | |
| 1301 | End Get | 1301 | End Get | |
| 1302 | Set(ByVal value As BusinessLayer) | 1302 | Set(ByVal value As BusinessLayer) | |
| 1303 | _PrimaryBusinessObject = value | 1303 | _PrimaryBusinessObject = value | |
| 1304 | End Set | 1304 | End Set | |
| 1305 | End Property | 1305 | End Property | |
| 1306 | 1306 | |||
| 1307 | ''' <summary> | 1307 | ''' <summary> | |
| 1308 | ''' The control that will receive focus when the form begins editing a business object | 1308 | ''' The control that will receive focus when the form begins editing a business object | |
| 1309 | ''' </summary> | 1309 | ''' </summary> | |
| 1310 | ''' <value></value> | 1310 | ''' <value></value> | |
| 1311 | ''' <remarks></remarks> | 1311 | ''' <remarks></remarks> | |
| 1312 | <Category(FORM_FRAMEWORK_CATEGORY), _ | 1312 | <Category(FORM_FRAMEWORK_CATEGORY), _ | |
| 1313 | Description("The control that will receive focus when the form begins editing a business object"), _ | 1313 | Description("The control that will receive focus when the form begins editing a business object"), _ | |
| 1314 | Editor(Constants.TE_OnFocusEditor, GetType(UITypeEditor))> _ | 1314 | Editor(Constants.TE_OnFocusEditor, GetType(UITypeEditor))> _ | |
| 1315 | Public Property FocusControlOnEdit() As Control | 1315 | Public Property FocusControlOnEdit() As Control | |
| 1316 | Get | 1316 | Get | |
| 1317 | Return _FocusControlOnEdit | 1317 | Return _FocusControlOnEdit | |
| 1318 | End Get | 1318 | End Get | |
| 1319 | Set(ByVal value As Control) | 1319 | Set(ByVal value As Control) | |
| 1320 | _FocusControlOnEdit = value | 1320 | _FocusControlOnEdit = value | |
| 1321 | End Set | 1321 | End Set | |
| 1322 | End Property | 1322 | End Property | |
| 1323 | 1323 | |||
| 1324 | ''' <summary> | 1324 | ''' <summary> | |
| 1325 | ''' The control that will receive focus when a new record is added to a business object | 1325 | ''' The control that will receive focus when a new record is added to a business object | |
| 1326 | ''' </summary> | 1326 | ''' </summary> | |
| 1327 | ''' <value></value> | 1327 | ''' <value></value> | |
| 1328 | ''' <remarks></remarks> | 1328 | ''' <remarks></remarks> | |
| 1329 | <Category(FORM_FRAMEWORK_CATEGORY), _ | 1329 | <Category(FORM_FRAMEWORK_CATEGORY), _ | |
| 1330 | Description("The control that will receive focus when a new record is added to a business object"), _ | 1330 | Description("The control that will receive focus when a new record is added to a business object"), _ | |
| 1331 | Editor(Constants.TE_OnFocusEditor, GetType(UITypeEditor))> _ | 1331 | Editor(Constants.TE_OnFocusEditor, GetType(UITypeEditor))> _ | |
| 1332 | Public Property FocusControlOnAdd() As Control | 1332 | Public Property FocusControlOnAdd() As Control | |
| 1333 | Get | 1333 | Get | |
| 1334 | Return _FocusControlOnAdd | 1334 | Return _FocusControlOnAdd | |
| 1335 | End Get | 1335 | End Get | |
| 1336 | Set(ByVal value As Control) | 1336 | Set(ByVal value As Control) | |
| 1337 | _FocusControlOnAdd = value | 1337 | _FocusControlOnAdd = value | |
| 1338 | End Set | 1338 | End Set | |
| 1339 | End Property | 1339 | End Property | |
| 1340 | 1340 | |||
| 1341 | ''' <summary> | 1341 | ''' <summary> | |
| 1342 | ''' The title displayed on the broken rules alert box if automatically shown | 1342 | ''' The title displayed on the broken rules alert box if automatically shown | |
| 1343 | ''' </summary> | 1343 | ''' </summary> | |
| 1344 | ''' <value></value> | 1344 | ''' <value></value> | |
| 1345 | ''' <remarks></remarks> | 1345 | ''' <remarks></remarks> | |
| 1346 | <Category(FORM_BROKENRULES_CATEGORY), _ | 1346 | <Category(FORM_BROKENRULES_CATEGORY), _ | |
| 1347 | Description("The title displayed on the broken rules alert box if automatically shown")> _ | 1347 | Description("The title displayed on the broken rules alert box if automatically shown")> _ | |
| 1348 | Public Property BrokenRulesAlertTitle() As String | 1348 | Public Property BrokenRulesAlertTitle() As String | |
| 1349 | Get | 1349 | Get | |
| 1350 | Return _BrokenRulesAlertTitle | 1350 | Return _BrokenRulesAlertTitle | |
| 1351 | End Get | 1351 | End Get | |
| 1352 | Set(ByVal value As String) | 1352 | Set(ByVal value As String) | |
| 1353 | _BrokenRulesAlertTitleText = value | 1353 | _BrokenRulesAlertTitleText = value | |
| 1354 | End Set | 1354 | End Set | |
| 1355 | End Property | 1355 | End Property | |
| 1356 | 1356 | |||
| 1357 | ''' <summary> | 1357 | ''' <summary> | |
| 1358 | ''' The key used to retrieve the BrokenRulesAlertTitle from the localization database | 1358 | ''' The key used to retrieve the BrokenRulesAlertTitle from the localization database | |
| 1359 | ''' (This property overrides the BrokenRulesAlertTitle property.) | 1359 | ''' (This property overrides the BrokenRulesAlertTitle property.) | |
| 1360 | ''' </summary> | 1360 | ''' </summary> | |
| 1361 | ''' <value></value> | 1361 | ''' <value></value> | |
| 1362 | ''' <remarks></remarks> | 1362 | ''' <remarks></remarks> | |
| 1363 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(""), _ | 1363 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(""), _ | |
| 1364 | Description("The key used to retrieve the BrokenRulesAlertTitle from the localization database (This property overrides the BrokenRulesAlertTitle property.)")> _ | 1364 | Description("The key used to retrieve the BrokenRulesAlertTitle from the localization database (This property overrides the BrokenRulesAlertTitle property.)")> _ | |
| 1365 | Public Property BrokenRulesAlertTitleKey() As String | 1365 | Public Property BrokenRulesAlertTitleKey() As String | |
| 1366 | Get | 1366 | Get | |
| 1367 | Return _BrokenRulesAlertTitleKey | 1367 | Return _BrokenRulesAlertTitleKey | |
| 1368 | End Get | 1368 | End Get | |
| 1369 | Set(ByVal value As String) | 1369 | Set(ByVal value As String) | |
| 1370 | _BrokenRulesAlertTitleKey = value | 1370 | _BrokenRulesAlertTitleKey = value | |
| 1371 | End Set | 1371 | End Set | |
| 1372 | End Property | 1372 | End Property | |
| 1373 | 1373 | |||
| 1374 | ''' <summary> | 1374 | ''' <summary> | |
| 1375 | ''' The text displayed on the broken rules alert box if automatically shown. This text is used when broken | 1375 | ''' The text displayed on the broken rules alert box if automatically shown. This text is used when broken | |
| 1376 | ''' rules only exist on the current row. (Should be in the form of "text {0} text" if the number of broken | 1376 | ''' rules only exist on the current row. (Should be in the form of "text {0} text" if the number of broken | |
| 1377 | ''' rules should be shown in the message.) | 1377 | ''' rules should be shown in the message.) | |
| 1378 | ''' Replacements: | 1378 | ''' Replacements: | |
| 1379 | ''' {0} - Count of broken rules on the current row | 1379 | ''' {0} - Count of broken rules on the current row | |
| 1380 | ''' {1} - Count of broken rules on all additional rows | 1380 | ''' {1} - Count of broken rules on all additional rows | |
| 1381 | ''' {2} - Count of broken rules total (ie. {0} + {1} = {2}) | 1381 | ''' {2} - Count of broken rules total (ie. {0} + {1} = {2}) | |
| 1382 | ''' </summary> | 1382 | ''' </summary> | |
| 1383 | ''' <value></value> | 1383 | ''' <value></value> | |
| 1384 | ''' <remarks></remarks> | 1384 | ''' <remarks></remarks> | |
| 1385 | <Category(FORM_BROKENRULES_CATEGORY), _ | 1385 | <Category(FORM_BROKENRULES_CATEGORY), _ | |
| 1386 | Description("The text dislpayed on the broken rules alert box if automatically shown. This text is used when broken " & _ | 1386 | Description("The text dislpayed on the broken rules alert box if automatically shown. This text is used when broken " & _ | |
| 1387 | "rules only exist on the current row. (Should be in the form of ""text {0} text"" if the number of broken " & _ | 1387 | "rules only exist on the current row. (Should be in the form of ""text {0} text"" if the number of broken " & _ | |
| 1388 | "rules should be shown in the message.)" & ControlChars.CrLf & _ | 1388 | "rules should be shown in the message.)" & ControlChars.CrLf & _ | |
| 1389 | "Replacements:" & ControlChars.CrLf & _ | 1389 | "Replacements:" & ControlChars.CrLf & _ | |
| 1390 | "{0} - Count of broken rules on the current row" & ControlChars.CrLf & _ | 1390 | "{0} - Count of broken rules on the current row" & ControlChars.CrLf & _ | |
| 1391 | "{1} - Count of broken rules on all additional rows" & ControlChars.CrLf & _ | 1391 | "{1} - Count of broken rules on all additional rows" & ControlChars.CrLf & _ | |
| 1392 | "{2} - Count of broken rules total (ie. {0} + {1} = {2})")> _ | 1392 | "{2} - Count of broken rules total (ie. {0} + {1} = {2})")> _ | |
| 1393 | Public Property BrokenRulesAlertText() As String | 1393 | Public Property BrokenRulesAlertText() As String | |
| 1394 | Get | 1394 | Get | |
| 1395 | Return _BrokenRulesAlertText | 1395 | Return _BrokenRulesAlertText | |
| 1396 | End Get | 1396 | End Get | |
| 1397 | Set(ByVal value As String) | 1397 | Set(ByVal value As String) | |
| 1398 | _BrokenRulesAlertTextText = value | 1398 | _BrokenRulesAlertTextText = value | |
| 1399 | End Set | 1399 | End Set | |
| 1400 | End Property | 1400 | End Property | |
| 1401 | 1401 | |||
| 1402 | ''' <summary> | 1402 | ''' <summary> | |
| 1403 | ''' The key used to retrieve the BrokenRulesAlertText from the localization database | 1403 | ''' The key used to retrieve the BrokenRulesAlertText from the localization database | |
| 1404 | ''' (This property overrides the BrokenRulesAlertText property.) | 1404 | ''' (This property overrides the BrokenRulesAlertText property.) | |
| 1405 | ''' </summary> | 1405 | ''' </summary> | |
| 1406 | ''' <value></value> | 1406 | ''' <value></value> | |
| 1407 | ''' <remarks></remarks> | 1407 | ''' <remarks></remarks> | |
| 1408 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(""), _ | 1408 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(""), _ | |
| 1409 | Description("The key used to retrieve the BrokenRulesAlertText from the localization database (This property overrides the BrokenRulesAlertText property.)")> _ | 1409 | Description("The key used to retrieve the BrokenRulesAlertText from the localization database (This property overrides the BrokenRulesAlertText property.)")> _ | |
| 1410 | Public Property BrokenRulesAlertTextKey() As String | 1410 | Public Property BrokenRulesAlertTextKey() As String | |
| 1411 | Get | 1411 | Get | |
| 1412 | Return _BrokenRulesAlertTextKey | 1412 | Return _BrokenRulesAlertTextKey | |
| 1413 | End Get | 1413 | End Get | |
| 1414 | Set(ByVal value As String) | 1414 | Set(ByVal value As String) | |
| 1415 | _BrokenRulesAlertTextKey = value | 1415 | _BrokenRulesAlertTextKey = value | |
| 1416 | End Set | 1416 | End Set | |
| 1417 | End Property | 1417 | End Property | |
| 1418 | 1418 | |||
| 1419 | ''' <summary> | 1419 | ''' <summary> | |
| 1420 | ''' The text dislpayed on the broken rules alert box if automatically shown. This text is used when broken | 1420 | ''' The text dislpayed on the broken rules alert box if automatically shown. This text is used when broken | |
| 1421 | ''' rules exist on more than the current row. (Should be in the form of "text {0} text" if the number of broken | 1421 | ''' rules exist on more than the current row. (Should be in the form of "text {0} text" if the number of broken | |
| 1422 | ''' rules should be shown in the message.) | 1422 | ''' rules should be shown in the message.) | |
| 1423 | ''' Replacements: | 1423 | ''' Replacements: | |
| 1424 | ''' {0} - Count of broken rules on the current row | 1424 | ''' {0} - Count of broken rules on the current row | |
| 1425 | ''' {1} - Count of broken rules on all additional rows | 1425 | ''' {1} - Count of broken rules on all additional rows | |
| 1426 | ''' {2} - Count of broken rules total (ie. {0} + {1} = {2}) | 1426 | ''' {2} - Count of broken rules total (ie. {0} + {1} = {2}) | |
| 1427 | ''' </summary> | 1427 | ''' </summary> | |
| 1428 | ''' <value></value> | 1428 | ''' <value></value> | |
| 1429 | ''' <remarks></remarks> | 1429 | ''' <remarks></remarks> | |
| 1430 | <Category(FORM_BROKENRULES_CATEGORY), _ | 1430 | <Category(FORM_BROKENRULES_CATEGORY), _ | |
| 1431 | Description("The text dislpayed on the broken rules alert box if automatically shown. This text is used when broken " & _ | 1431 | Description("The text dislpayed on the broken rules alert box if automatically shown. This text is used when broken " & _ | |
| 1432 | "rules exist on more than the current row. (Should be in the form of ""text {0} text"" if the number of broken " & _ | 1432 | "rules exist on more than the current row. (Should be in the form of ""text {0} text"" if the number of broken " & _ | |
| 1433 | "rules should be shown in the message.)" & ControlChars.CrLf & _ | 1433 | "rules should be shown in the message.)" & ControlChars.CrLf & _ | |
| 1434 | "Replacements:" & ControlChars.CrLf & _ | 1434 | "Replacements:" & ControlChars.CrLf & _ | |
| 1435 | "{0} - Count of broken rules on the current row" & ControlChars.CrLf & _ | 1435 | "{0} - Count of broken rules on the current row" & ControlChars.CrLf & _ | |
| 1436 | "{1} - Count of broken rules on all additional rows" & ControlChars.CrLf & _ | 1436 | "{1} - Count of broken rules on all additional rows" & ControlChars.CrLf & _ | |
| 1437 | "{2} - Count of broken rules total (ie. {0} + {1} = {2})")> _ | 1437 | "{2} - Count of broken rules total (ie. {0} + {1} = {2})")> _ | |
| 1438 | Public Property BrokenRulesAlertTextAdditionalRows() As String | 1438 | Public Property BrokenRulesAlertTextAdditionalRows() As String | |
| 1439 | Get | 1439 | Get | |
| 1440 | Return _BrokenRulesAlertTextMoreThanOneRow | 1440 | Return _BrokenRulesAlertTextMoreThanOneRow | |
| 1441 | End Get | 1441 | End Get | |
| 1442 | Set(ByVal value As String) | 1442 | Set(ByVal value As String) | |
| 1443 | _BrokenRulesAlertTextMoreThanOneRowText = value | 1443 | _BrokenRulesAlertTextMoreThanOneRowText = value | |
| 1444 | End Set | 1444 | End Set | |
| 1445 | End Property | 1445 | End Property | |
| 1446 | 1446 | |||
| 1447 | ''' <summary> | 1447 | ''' <summary> | |
| 1448 | ''' The key used to retrieve the BrokenRulesAlertTextAdditionalRows from the localization database | 1448 | ''' The key used to retrieve the BrokenRulesAlertTextAdditionalRows from the localization database | |
| 1449 | ''' (This property overrides the BrokenRulesAlertTextAdditionalRows property.) | 1449 | ''' (This property overrides the BrokenRulesAlertTextAdditionalRows property.) | |
| 1450 | ''' </summary> | 1450 | ''' </summary> | |
| 1451 | ''' <value></value> | 1451 | ''' <value></value> | |
| 1452 | ''' <remarks></remarks> | 1452 | ''' <remarks></remarks> | |
| 1453 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(""), _ | 1453 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(""), _ | |
| 1454 | Description("The key used to retrieve the BrokenRulesAlertTextAdditionalRows from the localization database (This property overrides the BrokenRulesAlertTextAdditionalRows property.)")> _ | 1454 | Description("The key used to retrieve the BrokenRulesAlertTextAdditionalRows from the localization database (This property overrides the BrokenRulesAlertTextAdditionalRows property.)")> _ | |
| 1455 | Public Property BrokenRulesAlertTextAdditionalRowsKey() As String | 1455 | Public Property BrokenRulesAlertTextAdditionalRowsKey() As String | |
| 1456 | Get | 1456 | Get | |
| 1457 | Return _BrokenRulesAlertTextMoreThanOneRowKey | 1457 | Return _BrokenRulesAlertTextMoreThanOneRowKey | |
| 1458 | End Get | 1458 | End Get | |
| 1459 | Set(ByVal value As String) | 1459 | Set(ByVal value As String) | |
| 1460 | _BrokenRulesAlertTextMoreThanOneRowKey = value | 1460 | _BrokenRulesAlertTextMoreThanOneRowKey = value | |
| 1461 | End Set | 1461 | End Set | |
| 1462 | End Property | 1462 | End Property | |
| 1463 | 1463 | |||
| 1464 | ''' <summary> | 1464 | ''' <summary> | |
| 1465 | ''' Determines whether or not to automatically show an alert box when broken rule are found | 1465 | ''' Determines whether or not to automatically show an alert box when broken rule are found | |
| 1466 | ''' </summary> | 1466 | ''' </summary> | |
| 1467 | ''' <value></value> | 1467 | ''' <value></value> | |
| 1468 | ''' <remarks></remarks> | 1468 | ''' <remarks></remarks> | |
| 1469 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(True), _ | 1469 | <Category(FORM_BROKENRULES_CATEGORY), DefaultValue(True), _ | |
| 1470 | Description("Determines whether or not to automatically show an alert box when broken rule are found")> _ | 1470 | Description("Determines whether or not to automatically show an alert box when broken rule are found")> _ | |
| 1471 | Public Property AutoShowBrokenRulesAlert() As Boolean | 1471 | Public Property AutoShowBrokenRulesAlert() As Boolean | |
| 1472 | Get | 1472 | Get | |
| 1473 | Return _AutoShowBrokenRulesAlert | 1473 | Return _AutoShowBrokenRulesAlert | |
| 1474 | End Get | 1474 | End Get | |
| 1475 | Set(ByVal value As Boolean) | 1475 | Set(ByVal value As Boolean) | |
| 1476 | _AutoShowBrokenRulesAlert = value | 1476 | _AutoShowBrokenRulesAlert = value | |
| 1477 | End Set | 1477 | End Set | |
| 1478 | End Property | 1478 | End Property | |
| 1479 | 1479 | |||
| 1480 | ''' <summary> | 1480 | ''' <summary> | |
| 1481 | ''' Gets the current editing state of the form determined by the editing state of the | 1481 | ''' Gets the current editing state of the form determined by the editing state of the | |
| 1482 | ''' business objects on the form. | 1482 | ''' business objects on the form. | |
| 1483 | ''' </summary> | 1483 | ''' </summary> | |
| 1484 | ''' <value></value> | 1484 | ''' <value></value> | |
| 1485 | ''' <returns></returns> | 1485 | ''' <returns></returns> | |
| 1486 | ''' <remarks></remarks> | 1486 | ''' <remarks></remarks> | |
| 1487 | Public ReadOnly Property EditingState() As BusinessEditingState | 1487 | Public ReadOnly Property EditingState() As BusinessEditingState | |
| 1488 | Get | 1488 | Get | |
| 1489 | Return Me.GetEditingState() | 1489 | Return Me.GetEditingState() | |
| 1490 | End Get | 1490 | End Get | |
| 1491 | End Property | 1491 | End Property | |
| 1492 | 1492 | |||
| 1493 | #End Region | 1493 | #End Region | |
| 1494 | 1494 | |||
| 1495 | #Region " Private Methods " | 1495 | #Region " Private Methods " | |
| 1496 | 1496 | |||
| 1497 | Private Sub Navigate(ByVal Direction As BusinessNavigationDirection, ByVal IndexOrKey As Object) | 1497 | Private Sub Navigate(ByVal Direction As BusinessNavigationDirection, ByVal IndexOrKey As Object) | |
| 1498 | '-- Establish locals | 1498 | '-- Establish locals | |
| 1499 | Dim loBO As BusinessLayer | 1499 | Dim loBO As BusinessLayer | |
| 1500 | Dim loPosition As BusinessNavigatedPosition = BusinessNavigatedPosition.RowDidNotChange | 1500 | Dim loPosition As BusinessNavigatedPosition = BusinessNavigatedPosition.RowDidNotChange | |
| 1501 | Dim lnIndex As Integer | 1501 | Dim lnIndex As Integer | |
| 1502 | Dim lnCount As Integer | 1502 | Dim lnCount As Integer | |
| 1503 | 1503 | |||
| 1504 | '-- Cycle through the business objects and navigate them if necessary | 1504 | '-- Cycle through the business objects and navigate them if necessary | |
| 1505 | For Each loBO In Me.GetListOfNavigateBOs | 1505 | For Each loBO In Me.GetListOfNavigateBOs | |
| 1506 | Select Case Direction | 1506 | Select Case Direction | |
| 1507 | Case BusinessNavigationDirection.First, _ | 1507 | Case BusinessNavigationDirection.First, _ | |
| 1508 | BusinessNavigationDirection.Last, _ | 1508 | BusinessNavigationDirection.Last, _ | |
| 1509 | BusinessNavigationDirection.Next, _ | 1509 | BusinessNavigationDirection.Next, _ | |
| 1510 | BusinessNavigationDirection.Prior | 1510 | BusinessNavigationDirection.Prior | |
| 1511 | loBO.Navigate(Direction) | 1511 | loBO.Navigate(Direction) | |
| 1512 | 1512 | |||
| 1513 | Case BusinessNavigationDirection.Absolute | 1513 | Case BusinessNavigationDirection.Absolute | |
| 1514 | loBO.Navigate(BusinessNavigationDirection.Absolute, CType(IndexOrKey, Integer)) | 1514 | loBO.Navigate(BusinessNavigationDirection.Absolute, CType(IndexOrKey, Integer)) | |
| 1515 | 1515 | |||
| 1516 | Case BusinessNavigationDirection.ByPrimaryKey | 1516 | Case BusinessNavigationDirection.ByPrimaryKey | |
| 1517 | loBO.NavigateToPrimaryKey(IndexOrKey) | 1517 | loBO.NavigateToPrimaryKey(IndexOrKey) | |
| 1518 | 1518 | |||
| 1519 | End Select | 1519 | End Select | |
| 1520 | 1520 | |||
| 1521 | '-- Get the index and count | 1521 | '-- Get the index and count | |
| 1522 | lnIndex = loBO.CurrentRowIndex | 1522 | lnIndex = loBO.CurrentRowIndex | |
| 1523 | lnCount = loBO.Count | 1523 | lnCount = loBO.Count | |
| 1524 | 1524 | |||
| 1525 | '-- Calculate the position of the business object | 1525 | '-- Calculate the position of the business object | |
| 1526 | '-- Calculate the position of the business object | 1526 | '-- Calculate the position of the business object | |
| 1527 | If (lnIndex = -1) OrElse (lnCount = 0) OrElse (lnCount = 1) Then | 1527 | If (lnIndex = -1) OrElse (lnCount = 0) OrElse (lnCount = 1) Then | |
| 1528 | loPosition = BusinessNavigatedPosition.NoVisibleRecords | 1528 | loPosition = BusinessNavigatedPosition.NoVisibleRecords | |
| 1529 | ElseIf lnIndex = 0 Then | 1529 | ElseIf lnIndex = 0 Then | |
| 1530 | loPosition = BusinessNavigatedPosition.First | 1530 | loPosition = BusinessNavigatedPosition.First | |
| 1531 | ElseIf lnIndex = lnCount - 1 Then | 1531 | ElseIf lnIndex = lnCount - 1 Then | |
| 1532 | loPosition = BusinessNavigatedPosition.Last | 1532 | loPosition = BusinessNavigatedPosition.Last | |
| 1533 | Else | 1533 | Else | |
| 1534 | loPosition = BusinessNavigatedPosition.SomewhereInTheMiddle | 1534 | loPosition = BusinessNavigatedPosition.SomewhereInTheMiddle | |
| 1535 | End If | 1535 | End If | |
| 1536 | Next | 1536 | Next | |
| 1537 | 1537 | |||
| 1538 | '-- Raise the navigated event | 1538 | '-- Raise the navigated event | |
| 1539 | RaiseEvent FormNavigated(New NavigatedEventArgs(loPosition, lnIndex, False)) | 1539 | RaiseEvent FormNavigated(New NavigatedEventArgs(loPosition, lnIndex, False)) | |
| 1540 | End Sub | 1540 | End Sub | |
| 1541 | 1541 | |||
| 1542 | Private Const EPRFD_DEFAULT As String = "Business_ErrorProviderRequiredFieldDesc" | 1542 | Private Const EPRFD_DEFAULT As String = "Business_ErrorProviderRequiredFieldDesc" | |
| 1543 | 1543 | |||
| 1544 | Private Function ShouldSerializeErrorProviderRequiredFieldDesc() As Boolean | 1544 | Private Function ShouldSerializeErrorProviderRequiredFieldDesc() As Boolean | |
| 1545 | If ((_ErrorProviderRequiredFieldDescKey.Trim().Length > 0) AndAlso _ | 1545 | If ((_ErrorProviderRequiredFieldDescKey.Trim().Length > 0) AndAlso _ | |
| 1546 | (_ErrorProviderRequiredFieldDesc.Equals(CANNOT_EVALUATE))) OrElse _ | 1546 | (_ErrorProviderRequiredFieldDesc.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1547 | (_ErrorProviderRequiredFieldDesc.Equals(Localization.RetrieveTextValue(EPRFD_DEFAULT, "This field requires entry."))) Then | 1547 | (_ErrorProviderRequiredFieldDesc.Equals(Localization.RetrieveTextValue(EPRFD_DEFAULT, "This field requires entry."))) Then | |
| 1548 | Return False | 1548 | Return False | |
| 1549 | Else | 1549 | Else | |
| 1550 | Return True | 1550 | Return True | |
| 1551 | End If | 1551 | End If | |
| 1552 | End Function | 1552 | End Function | |
| 1553 | 1553 | |||
| 1554 | Private Sub ResetErrorProviderRequiredFieldDesc() | 1554 | Private Sub ResetErrorProviderRequiredFieldDesc() | |
| 1555 | _ErrorProviderRequiredFieldDescText = EPRFD_DEFAULT | 1555 | _ErrorProviderRequiredFieldDescText = EPRFD_DEFAULT | |
| 1556 | End Sub | 1556 | End Sub | |
| 1557 | 1557 | |||
| 1558 | Private Const ADT_DEFAULT As String = "Business_AutoDeleteTitle" | 1558 | Private Const ADT_DEFAULT As String = "Business_AutoDeleteTitle" | |
| 1559 | 1559 | |||
| 1560 | Private Function ShouldSerializeAutoDeleteTitle() As Boolean | 1560 | Private Function ShouldSerializeAutoDeleteTitle() As Boolean | |
| 1561 | If ((_AutoDeleteTitleKey.Trim().Length > 0) AndAlso _ | 1561 | If ((_AutoDeleteTitleKey.Trim().Length > 0) AndAlso _ | |
| 1562 | (_AutoDeleteTitle.Equals(CANNOT_EVALUATE))) OrElse _ | 1562 | (_AutoDeleteTitle.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1563 | (_AutoDeleteTitle.Equals(Localization.RetrieveTextValue(ADT_DEFAULT, "Delete Record?"))) Then | 1563 | (_AutoDeleteTitle.Equals(Localization.RetrieveTextValue(ADT_DEFAULT, "Delete Record?"))) Then | |
| 1564 | Return False | 1564 | Return False | |
| 1565 | Else | 1565 | Else | |
| 1566 | Return True | 1566 | Return True | |
| 1567 | End If | 1567 | End If | |
| 1568 | End Function | 1568 | End Function | |
| 1569 | 1569 | |||
| 1570 | Private Sub ResetAutoDeleteTitle() | 1570 | Private Sub ResetAutoDeleteTitle() | |
| 1571 | _AutoDeleteTitleText = ADT_DEFAULT | 1571 | _AutoDeleteTitleText = ADT_DEFAULT | |
| 1572 | End Sub | 1572 | End Sub | |
| 1573 | 1573 | |||
| 1574 | Private Const ADM_DEFAULT As String = "Business_AutoDeleteMessage" | 1574 | Private Const ADM_DEFAULT As String = "Business_AutoDeleteMessage" | |
| 1575 | 1575 | |||
| 1576 | Private Function ShouldSerializeAutoDeleteMessage() As Boolean | 1576 | Private Function ShouldSerializeAutoDeleteMessage() As Boolean | |
| 1577 | If ((_AutoDeleteMessageKey.Trim().Length > 0) AndAlso _ | 1577 | If ((_AutoDeleteMessageKey.Trim().Length > 0) AndAlso _ | |
| 1578 | (_AutoDeleteMessage.Equals(CANNOT_EVALUATE))) OrElse _ | 1578 | (_AutoDeleteMessage.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1579 | (_AutoDeleteMessage.Equals(Localization.RetrieveTextValue(ADM_DEFAULT, "Are you sure you wish to delete the current record?"))) Then | 1579 | (_AutoDeleteMessage.Equals(Localization.RetrieveTextValue(ADM_DEFAULT, "Are you sure you wish to delete the current record?"))) Then | |
| 1580 | Return False | 1580 | Return False | |
| 1581 | Else | 1581 | Else | |
| 1582 | Return True | 1582 | Return True | |
| 1583 | End If | 1583 | End If | |
| 1584 | End Function | 1584 | End Function | |
| 1585 | 1585 | |||
| 1586 | Private Sub ResetAutoDeleteMessage() | 1586 | Private Sub ResetAutoDeleteMessage() | |
| 1587 | _AutoDeleteMessageText = Localization.RetrieveTextValue(ADM_DEFAULT, "Are you sure you wish to delete the current record?") | 1587 | _AutoDeleteMessageText = Localization.RetrieveTextValue(ADM_DEFAULT, "Are you sure you wish to delete the current record?") | |
| 1588 | End Sub | 1588 | End Sub | |
| 1589 | 1589 | |||
| 1590 | Private Const ASCT_DEFAULT As String = "Business_AutoSaveChangesTitle" | 1590 | Private Const ASCT_DEFAULT As String = "Business_AutoSaveChangesTitle" | |
| 1591 | 1591 | |||
| 1592 | Private Function ShouldSerializeAutoSaveChangesTitle() As Boolean | 1592 | Private Function ShouldSerializeAutoSaveChangesTitle() As Boolean | |
| 1593 | If ((_AutoSaveChangesTitleKey.Trim().Length > 0) AndAlso _ | 1593 | If ((_AutoSaveChangesTitleKey.Trim().Length > 0) AndAlso _ | |
| 1594 | (_AutoSaveChangesTitle.Equals(CANNOT_EVALUATE))) OrElse _ | 1594 | (_AutoSaveChangesTitle.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1595 | (_AutoSaveChangesTitle.Equals(Localization.RetrieveTextValue(ASCT_DEFAULT, "Save Changes?"))) Then | 1595 | (_AutoSaveChangesTitle.Equals(Localization.RetrieveTextValue(ASCT_DEFAULT, "Save Changes?"))) Then | |
| 1596 | Return False | 1596 | Return False | |
| 1597 | Else | 1597 | Else | |
| 1598 | Return True | 1598 | Return True | |
| 1599 | End If | 1599 | End If | |
| 1600 | End Function | 1600 | End Function | |
| 1601 | 1601 | |||
| 1602 | Private Sub ResetAutoSaveChangesTitle() | 1602 | Private Sub ResetAutoSaveChangesTitle() | |
| 1603 | _AutoSaveChangesTitleText = Localization.RetrieveTextValue(ASCT_DEFAULT, "Save Changes?") | 1603 | _AutoSaveChangesTitleText = Localization.RetrieveTextValue(ASCT_DEFAULT, "Save Changes?") | |
| 1604 | End Sub | 1604 | End Sub | |
| 1605 | 1605 | |||
| 1606 | Private Const ASCM_DEFAULT As String = "Business_AutoSaveChangesMessage" | 1606 | Private Const ASCM_DEFAULT As String = "Business_AutoSaveChangesMessage" | |
| 1607 | 1607 | |||
| 1608 | Private Function ShouldSerializeAutoSaveChangesMessage() As Boolean | 1608 | Private Function ShouldSerializeAutoSaveChangesMessage() As Boolean | |
| 1609 | If ((_AutoSaveChangesMessageKey.Trim().Length > 0) AndAlso _ | 1609 | If ((_AutoSaveChangesMessageKey.Trim().Length > 0) AndAlso _ | |
| 1610 | (_AutoSaveChangesMessage.Equals(CANNOT_EVALUATE))) OrElse _ | 1610 | (_AutoSaveChangesMessage.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1611 | (_AutoSaveChangesMessage.Equals(Localization.RetrieveTextValue(ASCM_DEFAULT, "Do you want to save changes?"))) Then | 1611 | (_AutoSaveChangesMessage.Equals(Localization.RetrieveTextValue(ASCM_DEFAULT, "Do you want to save changes?"))) Then | |
| 1612 | Return False | 1612 | Return False | |
| 1613 | Else | 1613 | Else | |
| 1614 | Return True | 1614 | Return True | |
| 1615 | End If | 1615 | End If | |
| 1616 | End Function | 1616 | End Function | |
| 1617 | 1617 | |||
| 1618 | Private Sub ResetAutoSaveChangesMessage() | 1618 | Private Sub ResetAutoSaveChangesMessage() | |
| 1619 | _AutoSaveChangesMessageText = Localization.RetrieveTextValue(ASCM_DEFAULT, "Do you want to save changes?") | 1619 | _AutoSaveChangesMessageText = Localization.RetrieveTextValue(ASCM_DEFAULT, "Do you want to save changes?") | |
| 1620 | End Sub | 1620 | End Sub | |
| 1621 | 1621 | |||
| 1622 | Private Const BRAT_DEFAULT As String = "Business_BrokenRulesAlertTitle" | 1622 | Private Const BRAT_DEFAULT As String = "Business_BrokenRulesAlertTitle" | |
| 1623 | 1623 | |||
| 1624 | Private Function ShouldSerializeBrokenRulesAlertTitle() As Boolean | 1624 | Private Function ShouldSerializeBrokenRulesAlertTitle() As Boolean | |
| 1625 | If ((_BrokenRulesAlertTitleKey.Trim().Length > 0) AndAlso _ | 1625 | If ((_BrokenRulesAlertTitleKey.Trim().Length > 0) AndAlso _ | |
| 1626 | (_BrokenRulesAlertTitle.Equals(CANNOT_EVALUATE))) OrElse _ | 1626 | (_BrokenRulesAlertTitle.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1627 | (_BrokenRulesAlertTitle.Equals(Localization.RetrieveTextValue(BRAT_DEFAULT, "Broken Rules Exist"))) Then | 1627 | (_BrokenRulesAlertTitle.Equals(Localization.RetrieveTextValue(BRAT_DEFAULT, "Broken Rules Exist"))) Then | |
| 1628 | Return False | 1628 | Return False | |
| 1629 | Else | 1629 | Else | |
| 1630 | Return True | 1630 | Return True | |
| 1631 | End If | 1631 | End If | |
| 1632 | End Function | 1632 | End Function | |
| 1633 | 1633 | |||
| 1634 | Private Sub ResetBrokenRulesAlertTitle() | 1634 | Private Sub ResetBrokenRulesAlertTitle() | |
| 1635 | _BrokenRulesAlertTitleText = Localization.RetrieveTextValue(BRAT_DEFAULT, "Broken Rules Exist") | 1635 | _BrokenRulesAlertTitleText = Localization.RetrieveTextValue(BRAT_DEFAULT, "Broken Rules Exist") | |
| 1636 | End Sub | 1636 | End Sub | |
| 1637 | 1637 | |||
| 1638 | Private Const BRAM_DEFAULT As String = "Business_BrokenRulesAlertText" | 1638 | Private Const BRAM_DEFAULT As String = "Business_BrokenRulesAlertText" | |
| 1639 | 1639 | |||
| 1640 | Private Function ShouldSerializeBrokenRulesAlertText() As Boolean | 1640 | Private Function ShouldSerializeBrokenRulesAlertText() As Boolean | |
| 1641 | If ((_BrokenRulesAlertTextKey.Trim().Length > 0) AndAlso _ | 1641 | If ((_BrokenRulesAlertTextKey.Trim().Length > 0) AndAlso _ | |
| 1642 | (_BrokenRulesAlertText.Equals(CANNOT_EVALUATE))) OrElse _ | 1642 | (_BrokenRulesAlertText.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1643 | (_BrokenRulesAlertText.Equals(Localization.RetrieveTextValue(BRAM_DEFAULT, "There are {0} broken rules that need to be corrected."))) Then | 1643 | (_BrokenRulesAlertText.Equals(Localization.RetrieveTextValue(BRAM_DEFAULT, "There are {0} broken rules that need to be corrected."))) Then | |
| 1644 | Return False | 1644 | Return False | |
| 1645 | Else | 1645 | Else | |
| 1646 | Return True | 1646 | Return True | |
| 1647 | End If | 1647 | End If | |
| 1648 | End Function | 1648 | End Function | |
| 1649 | 1649 | |||
| 1650 | Private Sub ResetBrokenRulesAlertText() | 1650 | Private Sub ResetBrokenRulesAlertText() | |
| 1651 | _BrokenRulesAlertTextText = Localization.RetrieveTextValue(BRAM_DEFAULT, "There are {0} broken rules that need to be corrected.") | 1651 | _BrokenRulesAlertTextText = Localization.RetrieveTextValue(BRAM_DEFAULT, "There are {0} broken rules that need to be corrected.") | |
| 1652 | End Sub | 1652 | End Sub | |
| 1653 | 1653 | |||
| 1654 | Private Const BRAMMTOR_DEFAULT As String = "Business_BrokenRulesAlertTextAdditionalRows" | 1654 | Private Const BRAMMTOR_DEFAULT As String = "Business_BrokenRulesAlertTextAdditionalRows" | |
| 1655 | 1655 | |||
| 1656 | Private Function ShouldSerializeBrokenRulesAlertTextAdditionalRows() As Boolean | 1656 | Private Function ShouldSerializeBrokenRulesAlertTextAdditionalRows() As Boolean | |
| 1657 | If ((_BrokenRulesAlertTextMoreThanOneRowKey.Trim().Length > 0) AndAlso _ | 1657 | If ((_BrokenRulesAlertTextMoreThanOneRowKey.Trim().Length > 0) AndAlso _ | |
| 1658 | (_BrokenRulesAlertTextMoreThanOneRow.Equals(CANNOT_EVALUATE))) OrElse _ | 1658 | (_BrokenRulesAlertTextMoreThanOneRow.Equals(CANNOT_EVALUATE))) OrElse _ | |
| 1659 | (_BrokenRulesAlertTextMoreThanOneRow.Equals(Localization.RetrieveTextValue(BRAMMTOR_DEFAULT, "There are {0} broken rules that need to be corrected on the current record, and there are {1} broken rules on additional records."))) Then | 1659 | (_BrokenRulesAlertTextMoreThanOneRow.Equals(Localization.RetrieveTextValue(BRAMMTOR_DEFAULT, "There are {0} broken rules that need to be corrected on the current record, and there are {1} broken rules on additional records."))) Then | |
| 1660 | Return False | 1660 | Return False | |
| 1661 | Else | 1661 | Else | |
| 1662 | Return True | 1662 | Return True | |
| 1663 | End If | 1663 | End If | |
| 1664 | End Function | 1664 | End Function | |
| 1665 | 1665 | |||
| 1666 | Private Sub ResetBrokenRulesAlertTextAdditionalRows() | 1666 | Private Sub ResetBrokenRulesAlertTextAdditionalRows() | |
| 1667 | _BrokenRulesAlertTextMoreThanOneRowText = Localization.RetrieveTextValue(BRAMMTOR_DEFAULT, "There are {0} broken rules that need to be corrected on the current record, and there are {1} broken rules on additional records.") | 1667 | _BrokenRulesAlertTextMoreThanOneRowText = Localization.RetrieveTextValue(BRAMMTOR_DEFAULT, "There are {0} broken rules that need to be corrected on the current record, and there are {1} broken rules on additional records.") | |
| 1668 | End Sub | 1668 | End Sub | |
| 1669 | 1669 | |||
| 1670 | ''' <summary> | 1670 | ''' <summary> | |
| 1671 | ''' Gets the current editing state of the form determined by the editing state of the | 1671 | ''' Gets the current editing state of the form determined by the editing state of the | |
| 1672 | ''' business objects on the form. | 1672 | ''' business objects on the form. | |
| 1673 | ''' </summary> | 1673 | ''' </summary> | |
| 1674 | ''' <returns></returns> | 1674 | ''' <returns></returns> | |
| 1675 | ''' <remarks></remarks> | 1675 | ''' <remarks></remarks> | |
| 1676 | Private Function GetEditingState() As BusinessEditingState | 1676 | Private Function GetEditingState() As BusinessEditingState | |
| 1677 | '-- Establish locals | 1677 | '-- Establish locals | |
| 1678 | Dim loReturn As BusinessEditingState = BusinessEditingState.Idle | 1678 | Dim loReturn As BusinessEditingState = BusinessEditingState.Idle | |
| 1679 | Dim loBO As BusinessLayer | 1679 | Dim loBO As BusinessLayer | |
| 1680 | 1680 | |||
| 1681 | '-- Determine if the form should be editing | 1681 | '-- Determine if the form should be editing | |
| 1682 | '-- Cycle through the business objects in the edit collection and determine | 1682 | '-- Cycle through the business objects in the edit collection and determine | |
| 1683 | ' if any of them are in editing state. | 1683 | ' if any of them are in editing state. | |
| 1684 | For Each loBO In Me.GetListOfEditBOs() | 1684 | For Each loBO In Me.GetListOfEditBOs() | |
| 1685 | '-- Check the state | 1685 | '-- Check the state | |
| 1686 | If loBO.EditingState = BusinessEditingState.Editing Then | 1686 | If loBO.EditingState = BusinessEditingState.Editing Then | |
| 1687 | loReturn = BusinessEditingState.Editing | 1687 | loReturn = BusinessEditingState.Editing | |
| 1688 | Exit For | 1688 | Exit For | |
| 1689 | End If | 1689 | End If | |
| 1690 | Next | 1690 | Next | |
| 1691 | 1691 | |||
| 1692 | '-- Determine if the form should be in adding mode | 1692 | '-- Determine if the form should be in adding mode | |
| 1693 | If loReturn = BusinessEditingState.Idle Then | 1693 | If loReturn = BusinessEditingState.Idle Then | |
| 1694 | For Each loBO In Me.GetListOfAddBOs() | 1694 | For Each loBO In Me.GetListOfAddBOs() | |
| 1695 | If loBO.EditingState = BusinessEditingState.Adding Then | 1695 | If loBO.EditingState = BusinessEditingState.Adding Then | |
| 1696 | loReturn = BusinessEditingState.Adding | 1696 | loReturn = BusinessEditingState.Adding | |
| 1697 | Exit For | 1697 | Exit For | |
| 1698 | End If | 1698 | End If | |
| 1699 | Next | 1699 | Next | |
| 1700 | End If | 1700 | End If | |
| 1701 | 1701 | |||
| 1702 | '-- Return the results | 1702 | '-- Return the results | |
| 1703 | Return loReturn | 1703 | Return loReturn | |
| 1704 | End Function | 1704 | End Function | |
| 1705 | 1705 | |||
| 1706 | Protected Overridable Sub RestoreSizeAndLocation() | 1706 | Protected Overridable Sub RestoreSizeAndLocation() | |
| 1707 | '-- Establish locals | 1707 | '-- Establish locals | |
| 1708 | Dim lnHeight As Integer | 1708 | Dim lnHeight As Integer | |
| 1709 | Dim lnWidth As Integer | 1709 | Dim lnWidth As Integer | |
| 1710 | Dim lnX As Integer | 1710 | Dim lnX As Integer | |
| 1711 | Dim lnY As Integer | 1711 | Dim lnY As Integer | |
| 1712 | Dim lnState As Integer | 1712 | Dim lnState As Integer | |
| 1713 | Dim lnStateDefault As Integer | 1713 | Dim lnStateDefault As Integer | |
| 1714 | Dim loScreen As Screen | 1714 | Dim loScreen As Screen | |
| 1715 | Dim llVisible As Boolean = False | 1715 | Dim llVisible As Boolean = False | |
| 1716 | 1716 | |||
| 1717 | '-- Get the state default | 1717 | '-- Get the state default | |
| 1718 | If Me.WindowState = FormWindowState.Maximized Then | 1718 | If Me.WindowState = FormWindowState.Maximized Then | |
| 1719 | lnStateDefault = 1 | 1719 | lnStateDefault = 1 | |
| 1720 | Else | 1720 | Else | |
| 1721 | lnStateDefault = 0 | 1721 | lnStateDefault = 0 | |
| 1722 | End If | 1722 | End If | |
| 1723 | 1723 | |||
| 1724 | '-- Get the height and width | 1724 | '-- Get the height and width | |
| 1725 | lnHeight = Me._RegistryStore.ReadInt32(FORM_HEIGHT_VALUE_NAME, Me.Height) | 1725 | lnHeight = Me._RegistryStore.ReadInt32(FORM_HEIGHT_VALUE_NAME, Me.Height) | |
| 1726 | lnWidth = Me._RegistryStore.ReadInt32(FORM_WIDTH_VALUE_NAME, Me.Width) | 1726 | lnWidth = Me._RegistryStore.ReadInt32(FORM_WIDTH_VALUE_NAME, Me.Width) | |
| 1727 | 1727 | |||
| 1728 | '-- Get the x and y | 1728 | '-- Get the x and y | |
| 1729 | lnX = Me._RegistryStore.ReadInt32(FORM_X_VALUE_NAME, Me.Location.X) | 1729 | lnX = Me._RegistryStore.ReadInt32(FORM_X_VALUE_NAME, Me.Location.X) | |
| 1730 | lnY = Me._RegistryStore.ReadInt32(FORM_Y_VALUE_NAME, Me.Location.Y) | 1730 | lnY = Me._RegistryStore.ReadInt32(FORM_Y_VALUE_NAME, Me.Location.Y) | |
| 1731 | 1731 | |||
| 1732 | '-- Get the state | 1732 | '-- Get the state | |
| 1733 | lnState = Me._RegistryStore.ReadInt32(FORM_STATE_VALUE_NAME, lnStateDefault) | 1733 | lnState = Me._RegistryStore.ReadInt32(FORM_STATE_VALUE_NAME, lnStateDefault) | |
| 1734 | 1734 | |||
| 1735 | '-- Set the size | 1735 | '-- Set the size | |
| 1736 | If Me._RememberFormSize Then | 1736 | If Me._RememberFormSize Then | |
| 1737 | Me.Height = lnHeight | 1737 | Me.Height = lnHeight | |
| 1738 | Me.Width = lnWidth | 1738 | Me.Width = lnWidth | |
| 1739 | End If | 1739 | End If | |
| 1740 | 1740 | |||
| 1741 | '-- Set the location | 1741 | '-- Set the location | |
| 1742 | If Me._RememberFormLocation Then | 1742 | If Me._RememberFormLocation Then | |
| 1743 | Me.Location = New Point(lnX, lnY) | 1743 | Me.Location = New Point(lnX, lnY) | |
| 1744 | Else | 1744 | Else | |
| 1745 | Select Case Me.StartPosition | 1745 | Select Case Me.StartPosition | |
| 1746 | Case FormStartPosition.CenterParent | 1746 | Case FormStartPosition.CenterParent | |
| 1747 | Me.CenterToParent() | 1747 | Me.CenterToParent() | |
| 1748 | Case FormStartPosition.CenterScreen | 1748 | Case FormStartPosition.CenterScreen | |
| 1749 | Me.CenterToScreen() | 1749 | Me.CenterToScreen() | |
| 1750 | End Select | 1750 | End Select | |
| 1751 | End If | 1751 | End If | |
| 1752 | 1752 | |||
| 1753 | '-- Set the state | 1753 | '-- Set the state | |
| 1754 | If Me._RememberFormMaximizedState Then | 1754 | If Me._RememberFormMaximizedState Then | |
| 1755 | If lnState = 1 Then | 1755 | If lnState = 1 Then | |
| 1756 | Me.WindowState = FormWindowState.Maximized | 1756 | Me.WindowState = FormWindowState.Maximized | |
| 1757 | Else | 1757 | Else | |
| 1758 | If Me.WindowState = FormWindowState.Maximized Then | 1758 | If Me.WindowState = FormWindowState.Maximized Then | |
| 1759 | Me.WindowState = FormWindowState.Normal | 1759 | Me.WindowState = FormWindowState.Normal | |
| 1760 | End If | 1760 | End If | |
| 1761 | End If | 1761 | End If | |
| 1762 | End If | 1762 | End If | |
| 1763 | 1763 | |||
| 1764 | '-- Check to make sure that the form is visible | 1764 | '-- Check to make sure that the form is visible | |
| 1765 | For Each loScreen In Screen.AllScreens | 1765 | For Each loScreen In Screen.AllScreens | |
| 1766 | '-- Check to see if this form is visible in the screens | 1766 | '-- Check to see if this form is visible in the screens | |
| 1767 | If loScreen.Bounds.IntersectsWith(Me.Bounds) Then | 1767 | If loScreen.Bounds.IntersectsWith(Me.Bounds) Then | |
| 1768 | llVisible = True | 1768 | llVisible = True | |
| 1769 | Exit For | 1769 | Exit For | |
| 1770 | End If | 1770 | End If | |
| 1771 | Next | 1771 | Next | |
| 1772 | 1772 | |||
| 1773 | If Not llVisible Then | 1773 | If Not llVisible Then | |
| 1774 | Select Case Me.StartPosition | 1774 | Select Case Me.StartPosition | |
| 1775 | Case FormStartPosition.CenterParent | 1775 | Case FormStartPosition.CenterParent | |
| 1776 | Me.CenterToParent() | 1776 | Me.CenterToParent() | |
| 1777 | Case FormStartPosition.CenterScreen, FormStartPosition.Manual, _ | 1777 | Case FormStartPosition.CenterScreen, FormStartPosition.Manual, _ | |
| 1778 | FormStartPosition.WindowsDefaultBounds, FormStartPosition.WindowsDefaultLocation | 1778 | FormStartPosition.WindowsDefaultBounds, FormStartPosition.WindowsDefaultLocation | |
| 1779 | Me.CenterToScreen() | 1779 | Me.CenterToScreen() | |
| 1780 | End Select | 1780 | End Select | |
| 1781 | End If | 1781 | End If | |
| 1782 | End Sub | 1782 | End Sub | |
| 1783 | 1783 | |||
| 1784 | Protected Overridable Sub SaveSizeAndLocation() | 1784 | Protected Overridable Sub SaveSizeAndLocation() | |
| 1785 | '-- Only write the settings if the key has been set | 1785 | '-- Only write the settings if the key has been set | |
| 1786 | If Me._RegistryStore.RegistryKey.Length > 0 Then | 1786 | If Me._RegistryStore.RegistryKey.Length > 0 Then | |
| 1787 | '-- Save the form size | 1787 | '-- Save the form size | |
| 1788 | If Me._RememberFormSize Then | 1788 | If Me._RememberFormSize Then | |
| 1789 | If Me.WindowState = FormWindowState.Maximized OrElse _ | 1789 | If Me.WindowState = FormWindowState.Maximized OrElse _ | |
| 1790 | Me.WindowState = FormWindowState.Minimized Then | 1790 | Me.WindowState = FormWindowState.Minimized Then | |
| 1791 | 1791 | |||
| 1792 | '-- Save the restore size | 1792 | '-- Save the restore size | |
| 1793 | Me._RegistryStore.WriteValue(FORM_HEIGHT_VALUE_NAME, Me.RestoreBounds.Height) | 1793 | Me._RegistryStore.WriteValue(FORM_HEIGHT_VALUE_NAME, Me.RestoreBounds.Height) | |
| 1794 | Me._RegistryStore.WriteValue(FORM_WIDTH_VALUE_NAME, Me.RestoreBounds.Width) | 1794 | Me._RegistryStore.WriteValue(FORM_WIDTH_VALUE_NAME, Me.RestoreBounds.Width) | |
| 1795 | Else | 1795 | Else | |
| 1796 | '-- Save the size | 1796 | '-- Save the size | |
| 1797 | Me._RegistryStore.WriteValue(FORM_HEIGHT_VALUE_NAME, Me.Height) | 1797 | Me._RegistryStore.WriteValue(FORM_HEIGHT_VALUE_NAME, Me.Height) | |
| 1798 | Me._RegistryStore.WriteValue(FORM_WIDTH_VALUE_NAME, Me.Width) | 1798 | Me._RegistryStore.WriteValue(FORM_WIDTH_VALUE_NAME, Me.Width) | |
| 1799 | End If | 1799 | End If | |
| 1800 | 1800 | |||
| 1801 | End If | 1801 | End If | |
| 1802 | 1802 | |||
| 1803 | '-- Save the form location | 1803 | '-- Save the form location | |
| 1804 | If Me._RememberFormLocation Then | 1804 | If Me._RememberFormLocation Then | |
| 1805 | If Me.WindowState = FormWindowState.Maximized OrElse _ | 1805 | If Me.WindowState = FormWindowState.Maximized OrElse _ | |
| 1806 | Me.WindowState = FormWindowState.Minimized Then | 1806 | Me.WindowState = FormWindowState.Minimized Then | |
| 1807 | '-- Save the restore location | 1807 | '-- Save the restore location | |
| 1808 | Me._RegistryStore.WriteValue(FORM_X_VALUE_NAME, Me.RestoreBounds.X) | 1808 | Me._RegistryStore.WriteValue(FORM_X_VALUE_NAME, Me.RestoreBounds.X) | |
| 1809 | Me._RegistryStore.WriteValue(FORM_Y_VALUE_NAME, Me.RestoreBounds.Y) | 1809 | Me._RegistryStore.WriteValue(FORM_Y_VALUE_NAME, Me.RestoreBounds.Y) | |
| 1810 | Else | 1810 | Else | |
| 1811 | '-- Save the location | 1811 | '-- Save the location | |
| 1812 | Me._RegistryStore.WriteValue(FORM_X_VALUE_NAME, Me.Location.X) | 1812 | Me._RegistryStore.WriteValue(FORM_X_VALUE_NAME, Me.Location.X) | |
| 1813 | Me._RegistryStore.WriteValue(FORM_Y_VALUE_NAME, Me.Location.Y) | 1813 | Me._RegistryStore.WriteValue(FORM_Y_VALUE_NAME, Me.Location.Y) | |
| 1814 | End If | 1814 | End If | |
| 1815 | End If | 1815 | End If | |
| 1816 | '-- Save the form state | 1816 | '-- Save the form state | |
| 1817 | If Me._RememberFormMaximizedState Then | 1817 | If Me._RememberFormMaximizedState Then | |
| 1818 | If Me.WindowState = FormWindowState.Maximized Then | 1818 | If Me.WindowState = FormWindowState.Maximized Then | |
| 1819 | Me._RegistryStore.WriteValue(FORM_STATE_VALUE_NAME, 1) | 1819 | Me._RegistryStore.WriteValue(FORM_STATE_VALUE_NAME, 1) | |
| 1820 | Else | 1820 | Else | |
| 1821 | Me._RegistryStore.WriteValue(FORM_STATE_VALUE_NAME, 0) | 1821 | Me._RegistryStore.WriteValue(FORM_STATE_VALUE_NAME, 0) | |
| 1822 | End If | 1822 | End If | |
| 1823 | End If | 1823 | End If | |
| 1824 | End If | 1824 | End If | |
| 1825 | End Sub | 1825 | End Sub | |
| 1826 | 1826 | |||
| 1827 | Private Sub ResetIncludeInFormAddType() | 1827 | Private Sub ResetIncludeInFormAddType() | |
| 1828 | Me._IncludeInFormAddType = IncludeInFormTypeOptions.PrimaryBusinessObject | 1828 | Me._IncludeInFormAddType = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1829 | End Sub | 1829 | End Sub | |
| 1830 | 1830 | |||
| 1831 | Private Sub ResetIncludeInFormDeleteType() | 1831 | Private Sub ResetIncludeInFormDeleteType() | |
| 1832 | Me._IncludeInFormDeleteType = IncludeInFormTypeOptions.PrimaryBusinessObject | 1832 | Me._IncludeInFormDeleteType = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1833 | End Sub | 1833 | End Sub | |
| 1834 | 1834 | |||
| 1835 | Private Sub ResetIncludeInFormEditType() | 1835 | Private Sub ResetIncludeInFormEditType() | |
| 1836 | Me._IncludeInFormEditType = IncludeInFormTypeOptions.PrimaryBusinessObject | 1836 | Me._IncludeInFormEditType = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1837 | End Sub | 1837 | End Sub | |
| 1838 | 1838 | |||
| 1839 | Private Sub ResetIncludeInFormNavigateType() | 1839 | Private Sub ResetIncludeInFormNavigateType() | |
| 1840 | Me._IncludeInFormNavigateType = IncludeInFormTypeOptions.PrimaryBusinessObject | 1840 | Me._IncludeInFormNavigateType = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1841 | End Sub | 1841 | End Sub | |
| 1842 | 1842 | |||
| 1843 | Private Sub ResetIncludeInFormSaveType() | 1843 | Private Sub ResetIncludeInFormSaveType() | |
| 1844 | Me._IncludeInFormSaveType = IncludeInFormTypeOptions.PrimaryBusinessObject | 1844 | Me._IncludeInFormSaveType = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1845 | End Sub | 1845 | End Sub | |
| 1846 | 1846 | |||
| 1847 | Private Sub ResetIncludeInFormUndoType() | 1847 | Private Sub ResetIncludeInFormUndoType() | |
| 1848 | Me._IncludeInFormUndoType = IncludeInFormTypeOptions.PrimaryBusinessObject | 1848 | Me._IncludeInFormUndoType = IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1849 | End Sub | 1849 | End Sub | |
| 1850 | 1850 | |||
| 1851 | Private Function ShouldSerializeIncludeInFormAddType() As Boolean | 1851 | Private Function ShouldSerializeIncludeInFormAddType() As Boolean | |
| 1852 | Return Me._IncludeInFormAddType <> IncludeInFormTypeOptions.PrimaryBusinessObject | 1852 | Return Me._IncludeInFormAddType <> IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1853 | End Function | 1853 | End Function | |
| 1854 | 1854 | |||
| 1855 | Private Function ShouldSerializeIncludeInFormDeleteType() As Boolean | 1855 | Private Function ShouldSerializeIncludeInFormDeleteType() As Boolean | |
| 1856 | Return Me._IncludeInFormDeleteType <> IncludeInFormTypeOptions.PrimaryBusinessObject | 1856 | Return Me._IncludeInFormDeleteType <> IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1857 | End Function | 1857 | End Function | |
| 1858 | 1858 | |||
| 1859 | Private Function ShouldSerializeIncludeInFormEditType() As Boolean | 1859 | Private Function ShouldSerializeIncludeInFormEditType() As Boolean | |
| 1860 | Return Me._IncludeInFormEditType <> IncludeInFormTypeOptions.PrimaryBusinessObject | 1860 | Return Me._IncludeInFormEditType <> IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1861 | End Function | 1861 | End Function | |
| 1862 | 1862 | |||
| 1863 | Private Function ShouldSerializeIncludeInFormNavigateType() As Boolean | 1863 | Private Function ShouldSerializeIncludeInFormNavigateType() As Boolean | |
| 1864 | Return Me._IncludeInFormNavigateType <> IncludeInFormTypeOptions.PrimaryBusinessObject | 1864 | Return Me._IncludeInFormNavigateType <> IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1865 | End Function | 1865 | End Function | |
| 1866 | 1866 | |||
| 1867 | Private Function ShouldSerializeIncludeInFormSaveType() As Boolean | 1867 | Private Function ShouldSerializeIncludeInFormSaveType() As Boolean | |
| 1868 | Return Me._IncludeInFormSaveType <> IncludeInFormTypeOptions.AllBusinessObjects | 1868 | Return Me._IncludeInFormSaveType <> IncludeInFormTypeOptions.AllBusinessObjects | |
| 1869 | End Function | 1869 | End Function | |
| 1870 | 1870 | |||
| 1871 | Private Function ShouldSerializeIncludeInFormUndoType() As Boolean | 1871 | Private Function ShouldSerializeIncludeInFormUndoType() As Boolean | |
| 1872 | Return Me._IncludeInFormUndoType <> IncludeInFormTypeOptions.PrimaryBusinessObject | 1872 | Return Me._IncludeInFormUndoType <> IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 1873 | End Function | 1873 | End Function | |
| 1874 | 1874 | |||
| 1875 | ''' <summary> | 1875 | ''' <summary> | |
| 1876 | ''' Initializes the form objects that have implemented the IInitOnFormLoad interface | 1876 | ''' Initializes the form objects that have implemented the IInitOnFormLoad interface | |
| 1877 | ''' </summary> | 1877 | ''' </summary> | |
| 1878 | ''' <remarks></remarks> | 1878 | ''' <remarks></remarks> | |
| 1879 | Private Sub InitializeFormLoadObjects() | 1879 | Private Sub InitializeFormLoadObjects() | |
| 1880 | '-- Establish Locals | 1880 | '-- Establish Locals | |
| 1881 | Dim loItem As IInitOnFormLoad | 1881 | Dim loItem As IInitOnFormLoad | |
| 1882 | Dim loPreItem As IPreInitOnFormLoad | 1882 | Dim loPreItem As IPreInitOnFormLoad | |
| 1883 | Dim loCompare As New LoadPriorityComparer() | 1883 | Dim loCompare As New LoadPriorityComparer() | |
| 1884 | 1884 | |||
| 1885 | '-- Sort the components to be pre-initialized | 1885 | '-- Sort the components to be pre-initialized | |
| 1886 | Me._ObjectsToPreInitOnLoad.Sort(loCompare) | 1886 | Me._ObjectsToPreInitOnLoad.Sort(loCompare) | |
| 1887 | 1887 | |||
| 1888 | '-- Cycle through the objects and initialize them | 1888 | '-- Cycle through the objects and initialize them | |
| 1889 | For Each loPreItem In Me._ObjectsToPreInitOnLoad | 1889 | For Each loPreItem In Me._ObjectsToPreInitOnLoad | |
| 1890 | '-- Raise the ParentFormLoading Event | 1890 | '-- Raise the ParentFormLoading Event | |
| 1891 | loPreItem.RaiseParentFormLoadingEvent() | 1891 | loPreItem.RaiseParentFormLoadingEvent() | |
| 1892 | 1892 | |||
| 1893 | '-- Execute the initialization method | 1893 | '-- Execute the initialization method | |
| 1894 | loPreItem.InitializeObject() | 1894 | loPreItem.InitializeObject() | |
| 1895 | Next | 1895 | Next | |
| 1896 | 1896 | |||
| 1897 | '-- Sort the components to be initialized | 1897 | '-- Sort the components to be initialized | |
| 1898 | _ObjectsToInitOnLoad.Sort(loCompare) | 1898 | _ObjectsToInitOnLoad.Sort(loCompare) | |
| 1899 | 1899 | |||
| 1900 | '-- Cycle through the objects and initialize them | 1900 | '-- Cycle through the objects and initialize them | |
| 1901 | For Each loItem In Me._ObjectsToInitOnLoad | 1901 | For Each loItem In Me._ObjectsToInitOnLoad | |
| 1902 | '-- Raise the ParentFormLoading Event | 1902 | '-- Raise the ParentFormLoading Event | |
| 1903 | loItem.RaiseParentFormLoadingEvent() | 1903 | loItem.RaiseParentFormLoadingEvent() | |
| 1904 | 1904 | |||
| 1905 | '-- Execute the initialization method | 1905 | '-- Execute the initialization method | |
| 1906 | loItem.InitializeObject() | 1906 | loItem.InitializeObject() | |
| 1907 | Next | 1907 | Next | |
| 1908 | End Sub | 1908 | End Sub | |
| 1909 | 1909 | |||
| 1910 | ''' <summary> | 1910 | ''' <summary> | |
| 1911 | ''' Adds an object to initialize on the form load | 1911 | ''' Adds an object to initialize on the form load | |
| 1912 | ''' </summary> | 1912 | ''' </summary> | |
| 1913 | ''' <param name="ObjectToInit"></param> | 1913 | ''' <param name="ObjectToInit"></param> | |
| 1914 | ''' <remarks></remarks> | 1914 | ''' <remarks></remarks> | |
| 1915 | Public Sub AddObjectToInitOnLoad(ByVal ObjectToInit As IInitOnFormLoad) Implements IContainerControl.AddObjectToInitOnLoad | 1915 | Public Sub AddObjectToInitOnLoad(ByVal ObjectToInit As IInitOnFormLoad) Implements IContainerControl.AddObjectToInitOnLoad | |
| 1916 | _ObjectsToInitOnLoad.Add(ObjectToInit) | 1916 | _ObjectsToInitOnLoad.Add(ObjectToInit) | |
| 1917 | End Sub | 1917 | End Sub | |
| 1918 | 1918 | |||
| 1919 | Public Sub AddObjectToPreInitOnFormLoad(ByVal ObjectToPreInit As IPreInitOnFormLoad) Implements IContainerControl.AddObjectToPreInitOnLoad | 1919 | Public Sub AddObjectToPreInitOnFormLoad(ByVal ObjectToPreInit As IPreInitOnFormLoad) Implements IContainerControl.AddObjectToPreInitOnLoad | |
| 1920 | If Not Me._ObjectsToPreInitOnLoad.Contains(ObjectToPreInit) Then | 1920 | If Not Me._ObjectsToPreInitOnLoad.Contains(ObjectToPreInit) Then | |
| 1921 | Me._ObjectsToPreInitOnLoad.Add(ObjectToPreInit) | 1921 | Me._ObjectsToPreInitOnLoad.Add(ObjectToPreInit) | |
| 1922 | End If | 1922 | End If | |
| 1923 | End Sub | 1923 | End Sub | |
| 1924 | 1924 | |||
| 1925 | Public Sub RemoveObjectFromInitOnFormLoad(ByVal ObjectToRemove As IInitOnFormLoad) Implements IContainerControl.RemoveObjectFromInitOnFormLoad | 1925 | Public Sub RemoveObjectFromInitOnFormLoad(ByVal ObjectToRemove As IInitOnFormLoad) Implements IContainerControl.RemoveObjectFromInitOnFormLoad | |
| 1926 | _ObjectsToInitOnLoad.Remove(ObjectToRemove) | 1926 | _ObjectsToInitOnLoad.Remove(ObjectToRemove) | |
| 1927 | End Sub | 1927 | End Sub | |
| 1928 | 1928 | |||
| 1929 | ''' <summary> | 1929 | ''' <summary> | |
| 1930 | ''' Refreshes the bound controls of all business objects on the form. | 1930 | ''' Refreshes the bound controls of all business objects on the form. | |
| 1931 | ''' </summary> | 1931 | ''' </summary> | |
| 1932 | ''' <remarks></remarks> | 1932 | ''' <remarks></remarks> | |
| 1933 | Public Sub RefreshBusinessObjects() | 1933 | Public Sub RefreshBusinessObjects() | |
| 1934 | '-- Establish locals | 1934 | '-- Establish locals | |
| 1935 | Dim loBO As BusinessLayer | 1935 | Dim loBO As BusinessLayer | |
| 1936 | 1936 | |||
| 1937 | '-- Cycle through the business objects on the form and refresh them | 1937 | '-- Cycle through the business objects on the form and refresh them | |
| 1938 | For Each loBO In Me.BusinessObjects | 1938 | For Each loBO In Me.BusinessObjects | |
| 1939 | '-- Refresh the bound controls | 1939 | '-- Refresh the bound controls | |
| 1940 | loBO.Refresh() | 1940 | loBO.Refresh() | |
| 1941 | Next | 1941 | Next | |
| 1942 | End Sub | 1942 | End Sub | |
| 1943 | 1943 | |||
| 1944 | ''' <summary> | 1944 | ''' <summary> | |
| 1945 | ''' Adds the business object to the collection | 1945 | ''' Adds the business object to the collection | |
| 1946 | ''' </summary> | 1946 | ''' </summary> | |
| 1947 | ''' <param name="BusinessObject"></param> | 1947 | ''' <param name="BusinessObject"></param> | |
| 1948 | ''' <remarks></remarks> | 1948 | ''' <remarks></remarks> | |
| 1949 | Public Sub AddBusinessObject(ByVal BusinessObject As BusinessLayerBase) Implements IContainerControl.AddBusinessObject | 1949 | Public Sub AddBusinessObject(ByVal BusinessObject As BusinessLayerBase) Implements IContainerControl.AddBusinessObject | |
| 1950 | AddBusinessObject(BusinessObject, True) | 1950 | AddBusinessObject(BusinessObject, True) | |
| 1951 | End Sub | 1951 | End Sub | |
| 1952 | 1952 | |||
| 1953 | ''' <summary> | 1953 | ''' <summary> | |
| 1954 | ''' Adds the business objec to the form collection. Also, the event handlers | 1954 | ''' Adds the business objec to the form collection. Also, the event handlers | |
| 1955 | ''' can be omitted or added when inserted into the collection. | 1955 | ''' can be omitted or added when inserted into the collection. | |
| 1956 | ''' </summary> | 1956 | ''' </summary> | |
| 1957 | ''' <param name="BusinessObject"></param> | 1957 | ''' <param name="BusinessObject"></param> | |
| 1958 | ''' <param name="AddEventHandlers"></param> | 1958 | ''' <param name="AddEventHandlers"></param> | |
| 1959 | ''' <remarks></remarks> | 1959 | ''' <remarks></remarks> | |
| 1960 | Public Sub AddBusinessObject(ByVal BusinessObject As BusinessLayerBase, ByVal AddEventHandlers As Boolean) | 1960 | Public Sub AddBusinessObject(ByVal BusinessObject As BusinessLayerBase, ByVal AddEventHandlers As Boolean) | |
| 1961 | '-- Add the business object to the internal collection | 1961 | '-- Add the business object to the internal collection | |
| 1962 | _BusinessObjects.Add(CType(BusinessObject, BusinessLayer)) | 1962 | _BusinessObjects.Add(CType(BusinessObject, BusinessLayer)) | |
| 1963 | 1963 | |||
| 1964 | If AddEventHandlers Then | 1964 | If AddEventHandlers Then | |
| 1965 | '-- Add the handlers for the events that will be raised to the UI | 1965 | '-- Add the handlers for the events that will be raised to the UI | |
| 1966 | AddBusinessObjectHandlers(CType(BusinessObject, BusinessLayer)) | 1966 | AddBusinessObjectHandlers(CType(BusinessObject, BusinessLayer)) | |
| 1967 | End If | 1967 | End If | |
| 1968 | End Sub | 1968 | End Sub | |
| 1969 | 1969 | |||
| 1970 | ''' <summary> | 1970 | ''' <summary> | |
| 1971 | ''' Removes a BusinessLayer from the form | 1971 | ''' Removes a BusinessLayer from the form | |
| 1972 | ''' </summary> | 1972 | ''' </summary> | |
| 1973 | ''' <param name="BusinessObject"></param> | 1973 | ''' <param name="BusinessObject"></param> | |
| 1974 | ''' <remarks></remarks> | 1974 | ''' <remarks></remarks> | |
| 1975 | Public Sub RemoveBusinessObject(ByVal BusinessObject As BusinessLayerBase) Implements IContainerControl.RemoveBusinessObject | 1975 | Public Sub RemoveBusinessObject(ByVal BusinessObject As BusinessLayerBase) Implements IContainerControl.RemoveBusinessObject | |
| 1976 | RemoveBusinessObject(CType(BusinessObject, BusinessLayer), True) | 1976 | RemoveBusinessObject(CType(BusinessObject, BusinessLayer), True) | |
| 1977 | End Sub | 1977 | End Sub | |
| 1978 | 1978 | |||
| 1979 | ''' <summary> | 1979 | ''' <summary> | |
| 1980 | ''' Removes a BusinessLayer from the form | 1980 | ''' Removes a BusinessLayer from the form | |
| 1981 | ''' </summary> | 1981 | ''' </summary> | |
| 1982 | ''' <param name="BusinessObject"></param> | 1982 | ''' <param name="BusinessObject"></param> | |
| 1983 | ''' <remarks></remarks> | 1983 | ''' <remarks></remarks> | |
| 1984 | Public Sub RemoveBusinessObject(ByVal BusinessObject As BusinessLayer, ByVal RemoveHandlers As Boolean) | 1984 | Public Sub RemoveBusinessObject(ByVal BusinessObject As BusinessLayer, ByVal RemoveHandlers As Boolean) | |
| 1985 | '-- Remove the business object from the internal list | 1985 | '-- Remove the business object from the internal list | |
| 1986 | Me._BusinessObjects.Remove(BusinessObject) | 1986 | Me._BusinessObjects.Remove(BusinessObject) | |
| 1987 | 1987 | |||
| 1988 | If RemoveHandlers Then | 1988 | If RemoveHandlers Then | |
| 1989 | '-- Remove the handlers for the business object | 1989 | '-- Remove the handlers for the business object | |
| 1990 | RemoveBusinessObjectHandlers(BusinessObject) | 1990 | RemoveBusinessObjectHandlers(BusinessObject) | |
| 1991 | End If | 1991 | End If | |
| 1992 | 1992 | |||
| 1993 | '-- Check to see if the primary business object of the form needs to be changed | 1993 | '-- Check to see if the primary business object of the form needs to be changed | |
| 1994 | If Me._PrimaryBusinessObject Is BusinessObject Then | 1994 | If Me._PrimaryBusinessObject Is BusinessObject Then | |
| 1995 | '-- Set the primary business object to nothing | 1995 | '-- Set the primary business object to nothing | |
| 1996 | _PrimaryBusinessObject = Nothing | 1996 | _PrimaryBusinessObject = Nothing | |
| 1997 | End If | 1997 | End If | |
| 1998 | End Sub | 1998 | End Sub | |
| 1999 | 1999 | |||
| 2000 | ''' <summary> | 2000 | ''' <summary> | |
| 2001 | ''' Handler that captures the EditingStateChanged event from a business object | 2001 | ''' Handler that captures the EditingStateChanged event from a business object | |
| 2002 | ''' and passes it up to the form | 2002 | ''' and passes it up to the form | |
| 2003 | ''' </summary> | 2003 | ''' </summary> | |
| 2004 | ''' <remarks></remarks> | 2004 | ''' <remarks></remarks> | |
| 2005 | Private Sub HandleBOEditingStateChanged(ByVal e As EditingStateChangedEventArgs) | 2005 | Private Sub HandleBOEditingStateChanged(ByVal e As EditingStateChangedEventArgs) | |
| 2006 | '-- Turn around and raise the form's event | 2006 | '-- Turn around and raise the form's event | |
| 2007 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | 2007 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | |
| 2008 | End Sub | 2008 | End Sub | |
| 2009 | 2009 | |||
| 2010 | #End Region | 2010 | #End Region | |
| 2011 | 2011 | |||
| 2012 | #Region " Protected Methods " | 2012 | #Region " Protected Methods " | |
| 2013 | 2013 | |||
| 2014 | ''' <summary> | 2014 | ''' <summary> | |
| 2015 | ''' Overrides the OnFormClosing method. | 2015 | ''' Overrides the OnFormClosing method. | |
| 2016 | ''' </summary> | 2016 | ''' </summary> | |
| 2017 | ''' <param name="e"></param> | 2017 | ''' <param name="e"></param> | |
| 2018 | ''' <remarks></remarks> | 2018 | ''' <remarks></remarks> | |
| 2019 | Protected Overrides Sub OnFormClosing(ByVal e As System.Windows.Forms.FormClosingEventArgs) | 2019 | Protected Overrides Sub OnFormClosing(ByVal e As System.Windows.Forms.FormClosingEventArgs) | |
| 2020 | '-- Raise the form closing event | 2020 | '-- Raise the form closing event | |
| 2021 | MyBase.OnFormClosing(e) | 2021 | MyBase.OnFormClosing(e) | |
| 2022 | 2022 | |||
| 2023 | '-- Handle the closing logic | 2023 | '-- Handle the closing logic | |
| 2024 | If Not e.Cancel Then | 2024 | If Not e.Cancel Then | |
| 2025 | '-- Establish locals | 2025 | '-- Establish locals | |
| 2026 | Dim loBO As BusinessLayer | 2026 | Dim loBO As BusinessLayer | |
| 2027 | Dim llSaveNeeded As Boolean = False | 2027 | Dim llSaveNeeded As Boolean = False | |
| 2028 | Dim loEventArgs As New UnsavedChangesExistEventArgs() | 2028 | Dim loEventArgs As New UnsavedChangesExistEventArgs() | |
| 2029 | 2029 | |||
| 2030 | '-- Cycle through the business objects and see if they need to be saved | 2030 | '-- Cycle through the business objects and see if they need to be saved | |
| 2031 | For Each loBO In _BusinessObjects | 2031 | For Each loBO In _BusinessObjects | |
| 2032 | If loBO.IsDirty Then | 2032 | If loBO.IsDirty Then | |
| 2033 | llSaveNeeded = True | 2033 | llSaveNeeded = True | |
| 2034 | Exit For | 2034 | Exit For | |
| 2035 | End If | 2035 | End If | |
| 2036 | Next | 2036 | Next | |
| 2037 | 2037 | |||
| 2038 | '-- See if a save is needed | 2038 | '-- See if a save is needed | |
| 2039 | If llSaveNeeded Then | 2039 | If llSaveNeeded Then | |
| 2040 | '-- Raise the event to the user | 2040 | '-- Raise the event to the user | |
| 2041 | RaiseUnsavedChangesExistEvent(loEventArgs) | 2041 | RaiseUnsavedChangesExistEvent(loEventArgs) | |
| 2042 | 2042 | |||
| 2043 | '-- Select the exit type | 2043 | '-- Select the exit type | |
| 2044 | Select Case loEventArgs.ExitStatus | 2044 | Select Case loEventArgs.ExitStatus | |
| 2045 | Case ExitStatus.CancelExit | 2045 | Case ExitStatus.CancelExit | |
| 2046 | e.Cancel = True | 2046 | e.Cancel = True | |
| 2047 | 2047 | |||
| 2048 | Case ExitStatus.ExitWithoutSave | 2048 | Case ExitStatus.ExitWithoutSave | |
| 2049 | '-- Do nothing and let the form close | 2049 | '-- Do nothing and let the form close | |
| 2050 | 2050 | |||
| 2051 | Case ExitStatus.ExitWithSave | 2051 | Case ExitStatus.ExitWithSave | |
| 2052 | '-- Save the form and exit if the save was successful | 2052 | '-- Save the form and exit if the save was successful | |
| 2053 | If Save() <> SaveUndoResult.Success Then | 2053 | If Save() <> SaveUndoResult.Success Then | |
| 2054 | e.Cancel = True | 2054 | e.Cancel = True | |
| 2055 | End If | 2055 | End If | |
| 2056 | End Select | 2056 | End Select | |
| 2057 | End If | 2057 | End If | |
| 2058 | 2058 | |||
| 2059 | '-- Save off the size & location Settings | 2059 | '-- Save off the size & location Settings | |
| 2060 | Me.SaveSizeAndLocation() | 2060 | Me.SaveSizeAndLocation() | |
| 2061 | End If | 2061 | End If | |
| 2062 | End Sub | 2062 | End Sub | |
| 2063 | 2063 | |||
| 2064 | ''' <summary> | 2064 | ''' <summary> | |
| 2065 | ''' Handles the Load event of the BaseForm class. | 2065 | ''' Handles the Load event of the BaseForm class. | |
| 2066 | ''' </summary> | 2066 | ''' </summary> | |
| 2067 | ''' <param name="e"></param> | 2067 | ''' <param name="e"></param> | |
| 2068 | ''' <remarks></remarks> | 2068 | ''' <remarks></remarks> | |
| 2069 | Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) | 2069 | Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) | |
| 2070 | '-- Handle the load logic | 2070 | '-- Handle the load logic | |
| 2071 | If Not Me.DesignMode Then | 2071 | If Not Me.DesignMode Then | |
| 2072 | '-- Set the localization on the form | 2072 | '-- Set the localization on the form | |
| 2073 | MicroFour.StrataFrame.UI.Localization.SetLocalizationOnControl(CType(Me, ILocalizable)) | 2073 | MicroFour.StrataFrame.UI.Localization.SetLocalizationOnControl(CType(Me, ILocalizable)) | |
| 2074 | 2074 | |||
| 2075 | '-- Initialize the objects on the form that have implemented the IInitOnFormLoad interface | 2075 | '-- Initialize the objects on the form that have implemented the IInitOnFormLoad interface | |
| 2076 | InitializeFormLoadObjects() | 2076 | InitializeFormLoadObjects() | |
| 2077 | End If | 2077 | End If | |
| 2078 | 2078 | |||
| 2079 | '-- Raise the load event | 2079 | '-- Raise the load event | |
| 2080 | MyBase.OnLoad(e) | 2080 | MyBase.OnLoad(e) | |
| 2081 | 2081 | |||
| 2082 | '-- Set the form size and location | 2082 | '-- Set the form size and location | |
| 2083 | If Not Me.DesignMode Then | 2083 | If Not Me.DesignMode Then | |
| 2084 | '-- Restore the form's settings | 2084 | '-- Restore the form's settings | |
| 2085 | Me.RestoreSizeAndLocation() | 2085 | Me.RestoreSizeAndLocation() | |
| 2086 | End If | 2086 | End If | |
| 2087 | End Sub | 2087 | End Sub | |
| 2088 | 2088 | |||
| 2089 | ''' <summary> | 2089 | ''' <summary> | |
| 2090 | ''' Overrides the OnShown method of the base class. | 2090 | ''' Overrides the OnShown method of the base class. | |
| 2091 | ''' </summary> | 2091 | ''' </summary> | |
| 2092 | ''' <param name="e"></param> | 2092 | ''' <param name="e"></param> | |
| 2093 | ''' <remarks></remarks> | 2093 | ''' <remarks></remarks> | |
| 2094 | Protected Overrides Sub OnShown(ByVal e As System.EventArgs) | 2094 | Protected Overrides Sub OnShown(ByVal e As System.EventArgs) | |
| 2095 | '-- Make sure the form was not aborted | 2095 | '-- Make sure the form was not aborted | |
| 2096 | If Me._FormAborted Then | 2096 | If Me._FormAborted Then | |
| 2097 | '-- Just close the form | 2097 | '-- Just close the form | |
| 2098 | Me.Close() | 2098 | Me.Close() | |
| 2099 | Else | 2099 | Else | |
| 2100 | '-- Raise the event | 2100 | '-- Raise the event | |
| 2101 | MyBase.OnShown(e) | 2101 | MyBase.OnShown(e) | |
| 2102 | End If | 2102 | End If | |
| 2103 | End Sub | 2103 | End Sub | |
| 2104 | 2104 | |||
| 2105 | ''' <summary> | 2105 | ''' <summary> | |
| 2106 | ''' Overrides the SetVisibleCore method of the base class. | 2106 | ''' Overrides the SetVisibleCore method of the base class. | |
| 2107 | ''' </summary> | 2107 | ''' </summary> | |
| 2108 | ''' <param name="value"></param> | 2108 | ''' <param name="value"></param> | |
| 2109 | ''' <remarks></remarks> | 2109 | ''' <remarks></remarks> | |
| 2110 | Protected Overrides Sub SetVisibleCore(ByVal value As Boolean) | 2110 | Protected Overrides Sub SetVisibleCore(ByVal value As Boolean) | |
| 2111 | '-- Make sure the security has not already been checked | 2111 | '-- Make sure the security has not already been checked | |
| 2112 | If Not Me._SecurityChecked Then | 2112 | If Not Me._SecurityChecked Then | |
| 2113 | '-- Establish locals | 2113 | '-- Establish locals | |
| 2114 | Dim loEventArgs As CheckSecurityEventArgs | 2114 | Dim loEventArgs As CheckSecurityEventArgs | |
| 2115 | 2115 | |||
| 2116 | '-- Test the permission to determine if the form can be opened | 2116 | '-- Test the permission to determine if the form can be opened | |
| 2117 | '-- Create the event args | 2117 | '-- Create the event args | |
| 2118 | loEventArgs = New CheckSecurityEventArgs(Me._ViewSecurityKey) | 2118 | loEventArgs = New CheckSecurityEventArgs(Me._ViewSecurityKey) | |
| 2119 | 2119 | |||
| 2120 | '-- Raise the event | 2120 | '-- Raise the event | |
| 2121 | OnCheckSecurity(loEventArgs) | 2121 | OnCheckSecurity(loEventArgs) | |
| 2122 | 2122 | |||
| 2123 | '-- Determine the results | 2123 | '-- Determine the results | |
| 2124 | If loEventArgs.PermissionInfo.Action <> PermissionAction.Grant Then | 2124 | If loEventArgs.PermissionInfo.Action <> PermissionAction.Grant Then | |
| 2125 | '-- Raise the denied event | 2125 | '-- Raise the denied event | |
| 2126 | Me.OnSecurityDenied(New SecurityDeniedEventArgs(Me._ViewSecurityKey, loEventArgs.PermissionInfo), True) | 2126 | Me.OnSecurityDenied(New SecurityDeniedEventArgs(Me._ViewSecurityKey, loEventArgs.PermissionInfo), True) | |
| 2127 | 2127 | |||
| 2128 | '-- Kill the form | 2128 | '-- Kill the form | |
| 2129 | Me._FormAborted = True | 2129 | Me._FormAborted = True | |
| 2130 | Else | 2130 | Else | |
| 2131 | '-- Make the base method call | 2131 | '-- Make the base method call | |
| 2132 | MyBase.SetVisibleCore(value) | 2132 | MyBase.SetVisibleCore(value) | |
| 2133 | End If | 2133 | End If | |
| 2134 | 2134 | |||
| 2135 | '-- Set the flag that we have checked security | 2135 | '-- Set the flag that we have checked security | |
| 2136 | Me._SecurityChecked = True | 2136 | Me._SecurityChecked = True | |
| 2137 | ElseIf Not Me._FormAborted Then | 2137 | ElseIf Not Me._FormAborted Then | |
| 2138 | '-- Just make the base call | 2138 | '-- Just make the base call | |
| 2139 | MyBase.SetVisibleCore(value) | 2139 | MyBase.SetVisibleCore(value) | |
| 2140 | End If | 2140 | End If | |
| 2141 | End Sub | 2141 | End Sub | |
| 2142 | 2142 | |||
| 2143 | #End Region | 2143 | #End Region | |
| 2144 | 2144 | |||
| 2145 | #Region " Public Methods " | 2145 | #Region " Public Methods " | |
| 2146 | 2146 | |||
| 2147 | ''' <summary> | 2147 | ''' <summary> | |
| 2148 | ''' Adds a new record to the business objects marked with IncludeInFormAdd. | 2148 | ''' Adds a new record to the business objects marked with IncludeInFormAdd. | |
| 2149 | ''' </summary> | 2149 | ''' </summary> | |
| 2150 | ''' <remarks></remarks> | 2150 | ''' <remarks></remarks> | |
| 2151 | Public Overridable Sub Add() | 2151 | Public Overridable Sub Add() | |
| 2152 | Me.Add(False) | 2152 | Me.Add(False) | |
| 2153 | End Sub | 2153 | End Sub | |
| 2154 | 2154 | |||
| 2155 | ''' <summary> | 2155 | ''' <summary> | |
| 2156 | ''' Adds a new record to the business objects marked with IncludeInFormAdd and optionally checks security | 2156 | ''' Adds a new record to the business objects marked with IncludeInFormAdd and optionally checks security | |
| 2157 | ''' on each of the business objects. | 2157 | ''' on each of the business objects. | |
| 2158 | ''' </summary> | 2158 | ''' </summary> | |
| 2159 | ''' <param name="CheckSecurity"></param> | 2159 | ''' <param name="CheckSecurity"></param> | |
| 2160 | ''' <remarks></remarks> | 2160 | ''' <remarks></remarks> | |
| 2161 | Public Overridable Sub Add(ByVal CheckSecurity As Boolean) | 2161 | Public Overridable Sub Add(ByVal CheckSecurity As Boolean) | |
| 2162 | '-- Establish locals | 2162 | '-- Establish locals | |
| 2163 | Dim loBO As BusinessLayer | 2163 | Dim loBO As BusinessLayer | |
| 2164 | 2164 | |||
| 2165 | '-- Cycle through the business objects and call Add on the ones that need it | 2165 | '-- Cycle through the business objects and call Add on the ones that need it | |
| 2166 | For Each loBO In Me.GetListOfAddBOs | 2166 | For Each loBO In Me.GetListOfAddBOs | |
| 2167 | '-- Call add if neccessary | 2167 | '-- Call add if neccessary | |
| 2168 | loBO.Add(CheckSecurity) | 2168 | loBO.Add(CheckSecurity) | |
| 2169 | Next | 2169 | Next | |
| 2170 | 2170 | |||
| 2171 | '-- See if there is an object to set the focus on | 2171 | '-- See if there is an object to set the focus on | |
| 2172 | If _FocusControlOnAdd IsNot Nothing Then | 2172 | If _FocusControlOnAdd IsNot Nothing Then | |
| 2173 | SetFocusToControl(_FocusControlOnAdd) | 2173 | SetFocusToControl(_FocusControlOnAdd) | |
| 2174 | End If | 2174 | End If | |
| 2175 | 2175 | |||
| 2176 | '-- Set the editing state | 2176 | '-- Set the editing state | |
| 2177 | If loBO IsNot Nothing Then | 2177 | If loBO IsNot Nothing Then | |
| 2178 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | 2178 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | |
| 2179 | End If | 2179 | End If | |
| 2180 | End Sub | 2180 | End Sub | |
| 2181 | 2181 | |||
| 2182 | ''' <summary> | 2182 | ''' <summary> | |
| 2183 | ''' Deletes the current record of the business objects marked with IncludeInFormDelete. | 2183 | ''' Deletes the current record of the business objects marked with IncludeInFormDelete. | |
| 2184 | ''' </summary> | 2184 | ''' </summary> | |
| 2185 | ''' <remarks></remarks> | 2185 | ''' <remarks></remarks> | |
| 2186 | Public Overridable Sub Delete() | 2186 | Public Overridable Sub Delete() | |
| 2187 | Me.Delete(True, False) | 2187 | Me.Delete(True, False) | |
| 2188 | End Sub | 2188 | End Sub | |
| 2189 | 2189 | |||
| 2190 | ''' <summary> | 2190 | ''' <summary> | |
| 2191 | ''' Deletes the current record of the business objects marked with IncludeInFormDelete. | 2191 | ''' Deletes the current record of the business objects marked with IncludeInFormDelete. | |
| 2192 | ''' </summary> | 2192 | ''' </summary> | |
| 2193 | ''' <param name="OnlyMarkAsDeleted"></param> | 2193 | ''' <param name="OnlyMarkAsDeleted"></param> | |
| 2194 | ''' <remarks></remarks> | 2194 | ''' <remarks></remarks> | |
| 2195 | Public Overridable Sub Delete(ByVal OnlyMarkAsDeleted As Boolean) | 2195 | Public Overridable Sub Delete(ByVal OnlyMarkAsDeleted As Boolean) | |
| 2196 | Me.Delete(OnlyMarkAsDeleted, False) | 2196 | Me.Delete(OnlyMarkAsDeleted, False) | |
| 2197 | End Sub | 2197 | End Sub | |
| 2198 | 2198 | |||
| 2199 | ''' <summary> | 2199 | ''' <summary> | |
| 2200 | ''' Deletes the current record of the business objects marked with IncludeInFormDelete. | 2200 | ''' Deletes the current record of the business objects marked with IncludeInFormDelete. | |
| 2201 | ''' </summary> | 2201 | ''' </summary> | |
| 2202 | ''' <param name="OnlyMarkAsDeleted"></param> | 2202 | ''' <param name="OnlyMarkAsDeleted"></param> | |
| 2203 | ''' <param name="CheckSecurity"></param> | 2203 | ''' <param name="CheckSecurity"></param> | |
| 2204 | ''' <remarks></remarks> | 2204 | ''' <remarks></remarks> | |
| 2205 | Public Overridable Sub Delete(ByVal OnlyMarkAsDeleted As Boolean, ByVal CheckSecurity As Boolean) | 2205 | Public Overridable Sub Delete(ByVal OnlyMarkAsDeleted As Boolean, ByVal CheckSecurity As Boolean) | |
| 2206 | '-- Establish locals | 2206 | '-- Establish locals | |
| 2207 | Dim loBO As BusinessLayer | 2207 | Dim loBO As BusinessLayer | |
| 2208 | 2208 | |||
| 2209 | '-- Cycle through the business objects and delete the one that does not need to be there | 2209 | '-- Cycle through the business objects and delete the one that does not need to be there | |
| 2210 | For Each loBO In Me.GetListOfDeleteBOs() | 2210 | For Each loBO In Me.GetListOfDeleteBOs() | |
| 2211 | '-- Call DeleteCurrentRow if necessary | 2211 | '-- Call DeleteCurrentRow if necessary | |
| 2212 | loBO.DeleteCurrentRow(CheckSecurity, OnlyMarkAsDeleted) | 2212 | loBO.DeleteCurrentRow(CheckSecurity, OnlyMarkAsDeleted) | |
| 2213 | Next | 2213 | Next | |
| 2214 | 2214 | |||
| 2215 | '-- Set the editing state | 2215 | '-- Set the editing state | |
| 2216 | If loBO IsNot Nothing Then | 2216 | If loBO IsNot Nothing Then | |
| 2217 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | 2217 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | |
| 2218 | End If | 2218 | End If | |
| 2219 | End Sub | 2219 | End Sub | |
| 2220 | 2220 | |||
| 2221 | ''' <summary> | 2221 | ''' <summary> | |
| 2222 | ''' Edits the current record of the business objects marked with IncludeInFormEdit. | 2222 | ''' Edits the current record of the business objects marked with IncludeInFormEdit. | |
| 2223 | ''' </summary> | 2223 | ''' </summary> | |
| 2224 | ''' <remarks></remarks> | 2224 | ''' <remarks></remarks> | |
| 2225 | Public Overridable Sub Edit() | 2225 | Public Overridable Sub Edit() | |
| 2226 | Me.Edit(False) | 2226 | Me.Edit(False) | |
| 2227 | End Sub | 2227 | End Sub | |
| 2228 | 2228 | |||
| 2229 | ''' <summary> | 2229 | ''' <summary> | |
| 2230 | ''' Edits the current record of the business objects marked with IncludeInFormEdit. | 2230 | ''' Edits the current record of the business objects marked with IncludeInFormEdit. | |
| 2231 | ''' </summary> | 2231 | ''' </summary> | |
| 2232 | ''' <remarks></remarks> | 2232 | ''' <remarks></remarks> | |
| 2233 | Public Overridable Sub Edit(ByVal CheckSecurity As Boolean) | 2233 | Public Overridable Sub Edit(ByVal CheckSecurity As Boolean) | |
| 2234 | '-- Establish locals | 2234 | '-- Establish locals | |
| 2235 | Dim loBO As BusinessLayer | 2235 | Dim loBO As BusinessLayer | |
| 2236 | 2236 | |||
| 2237 | '-- Cycle through the business objects and call Edit if necessary | 2237 | '-- Cycle through the business objects and call Edit if necessary | |
| 2238 | For Each loBO In Me.GetListOfEditBOs() | 2238 | For Each loBO In Me.GetListOfEditBOs() | |
| 2239 | loBO.Edit(CheckSecurity) | 2239 | loBO.Edit(CheckSecurity) | |
| 2240 | Next | 2240 | Next | |
| 2241 | 2241 | |||
| 2242 | '-- Set the focus control | 2242 | '-- Set the focus control | |
| 2243 | If _FocusControlOnEdit IsNot Nothing Then | 2243 | If _FocusControlOnEdit IsNot Nothing Then | |
| 2244 | SetFocusToControl(_FocusControlOnEdit) | 2244 | SetFocusToControl(_FocusControlOnEdit) | |
| 2245 | End If | 2245 | End If | |
| 2246 | 2246 | |||
| 2247 | '-- Set the editing state | 2247 | '-- Set the editing state | |
| 2248 | If loBO IsNot Nothing Then | 2248 | If loBO IsNot Nothing Then | |
| 2249 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | 2249 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | |
| 2250 | End If | 2250 | End If | |
| 2251 | End Sub | 2251 | End Sub | |
| 2252 | 2252 | |||
| 2253 | ''' <summary> | 2253 | ''' <summary> | |
| 2254 | ''' Gets the error value that has been assigned to this control. | 2254 | ''' Gets the error value that has been assigned to this control. | |
| 2255 | ''' </summary> | 2255 | ''' </summary> | |
| 2256 | ''' <param name="Control"></param> | 2256 | ''' <param name="Control"></param> | |
| 2257 | ''' <returns></returns> | 2257 | ''' <returns></returns> | |
| 2258 | ''' <remarks></remarks> | 2258 | ''' <remarks></remarks> | |
| 2259 | Public Function GetErrorProvider(ByVal Control As Control) As String | 2259 | Public Function GetErrorProvider(ByVal Control As Control) As String | |
| 2260 | '-- Set the error provider | 2260 | '-- Set the error provider | |
| 2261 | If _ErrorProvider Is Nothing Then | 2261 | If _ErrorProvider Is Nothing Then | |
| 2262 | _ErrorProvider = New ErrorProvider() | 2262 | _ErrorProvider = New ErrorProvider() | |
| 2263 | _ErrorProvider.BlinkRate = Me._ErrorProviderBlinkRate | 2263 | _ErrorProvider.BlinkRate = Me._ErrorProviderBlinkRate | |
| 2264 | _ErrorProvider.BlinkStyle = Me._ErrorProviderBlinkStyle | 2264 | _ErrorProvider.BlinkStyle = Me._ErrorProviderBlinkStyle | |
| 2265 | _ErrorProvider.Icon = Me._ErrorProviderIcon | 2265 | _ErrorProvider.Icon = Me._ErrorProviderIcon | |
| 2266 | End If | 2266 | End If | |
| 2267 | 2267 | |||
| 2268 | '-- Set the error on the control | 2268 | '-- Set the error on the control | |
| 2269 | Return Me._ErrorProvider.GetError(Control) | 2269 | Return Me._ErrorProvider.GetError(Control) | |
| 2270 | End Function | 2270 | End Function | |
| 2271 | 2271 | |||
| 2272 | ''' <summary> | 2272 | ''' <summary> | |
| 2273 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | 2273 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | |
| 2274 | ''' when Add() is called on the form. | 2274 | ''' when Add() is called on the form. | |
| 2275 | ''' </summary> | 2275 | ''' </summary> | |
| 2276 | ''' <returns></returns> | 2276 | ''' <returns></returns> | |
| 2277 | ''' <remarks></remarks> | 2277 | ''' <remarks></remarks> | |
| 2278 | Public Function GetListOfAddBOs() As BusinessLayer() | 2278 | Public Function GetListOfAddBOs() As BusinessLayer() | |
| 2279 | '-- Establish locals | 2279 | '-- Establish locals | |
| 2280 | Dim loReturn As New List(Of BusinessLayer) | 2280 | Dim loReturn As New List(Of BusinessLayer) | |
| 2281 | Dim loBO As BusinessLayer | 2281 | Dim loBO As BusinessLayer | |
| 2282 | 2282 | |||
| 2283 | '-- Build the list | 2283 | '-- Build the list | |
| 2284 | Select Case Me._IncludeInFormAddType | 2284 | Select Case Me._IncludeInFormAddType | |
| 2285 | Case IncludeInFormTypeOptions.AllBusinessObjects | 2285 | Case IncludeInFormTypeOptions.AllBusinessObjects | |
| 2286 | '-- Add all of the business objects to the list | 2286 | '-- Add all of the business objects to the list | |
| 2287 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | 2287 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | |
| 2288 | 2288 | |||
| 2289 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | 2289 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | |
| 2290 | '-- Add the business objects that should be added | 2290 | '-- Add the business objects that should be added | |
| 2291 | For Each loBO In Me._BusinessObjects | 2291 | For Each loBO In Me._BusinessObjects | |
| 2292 | If loBO.IncludeInFormAdd Then | 2292 | If loBO.IncludeInFormAdd Then | |
| 2293 | loReturn.Add(loBO) | 2293 | loReturn.Add(loBO) | |
| 2294 | End If | 2294 | End If | |
| 2295 | Next | 2295 | Next | |
| 2296 | 2296 | |||
| 2297 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | 2297 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 2298 | '-- Add the primary business object | 2298 | '-- Add the primary business object | |
| 2299 | If Me._PrimaryBusinessObject IsNot Nothing Then | 2299 | If Me._PrimaryBusinessObject IsNot Nothing Then | |
| 2300 | loReturn.Add(Me._PrimaryBusinessObject) | 2300 | loReturn.Add(Me._PrimaryBusinessObject) | |
| 2301 | End If | 2301 | End If | |
| 2302 | 2302 | |||
| 2303 | End Select | 2303 | End Select | |
| 2304 | 2304 | |||
| 2305 | '-- Return the list | 2305 | '-- Return the list | |
| 2306 | Return loReturn.ToArray() | 2306 | Return loReturn.ToArray() | |
| 2307 | End Function | 2307 | End Function | |
| 2308 | 2308 | |||
| 2309 | ''' <summary> | 2309 | ''' <summary> | |
| 2310 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | 2310 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | |
| 2311 | ''' when Delete() is called on the form. | 2311 | ''' when Delete() is called on the form. | |
| 2312 | ''' </summary> | 2312 | ''' </summary> | |
| 2313 | ''' <returns></returns> | 2313 | ''' <returns></returns> | |
| 2314 | ''' <remarks></remarks> | 2314 | ''' <remarks></remarks> | |
| 2315 | Public Function GetListOfDeleteBOs() As BusinessLayer() | 2315 | Public Function GetListOfDeleteBOs() As BusinessLayer() | |
| 2316 | '-- Establish locals | 2316 | '-- Establish locals | |
| 2317 | Dim loReturn As New List(Of BusinessLayer) | 2317 | Dim loReturn As New List(Of BusinessLayer) | |
| 2318 | Dim loBO As BusinessLayer | 2318 | Dim loBO As BusinessLayer | |
| 2319 | 2319 | |||
| 2320 | '-- Build the list | 2320 | '-- Build the list | |
| 2321 | Select Case Me._IncludeInFormDeleteType | 2321 | Select Case Me._IncludeInFormDeleteType | |
| 2322 | Case IncludeInFormTypeOptions.AllBusinessObjects | 2322 | Case IncludeInFormTypeOptions.AllBusinessObjects | |
| 2323 | '-- Add all of the business objects to the list | 2323 | '-- Add all of the business objects to the list | |
| 2324 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | 2324 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | |
| 2325 | 2325 | |||
| 2326 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | 2326 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | |
| 2327 | '-- Add the business objects that should be added | 2327 | '-- Add the business objects that should be added | |
| 2328 | For Each loBO In Me._BusinessObjects | 2328 | For Each loBO In Me._BusinessObjects | |
| 2329 | If loBO.IncludeInFormDelete Then | 2329 | If loBO.IncludeInFormDelete Then | |
| 2330 | loReturn.Add(loBO) | 2330 | loReturn.Add(loBO) | |
| 2331 | End If | 2331 | End If | |
| 2332 | Next | 2332 | Next | |
| 2333 | 2333 | |||
| 2334 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | 2334 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 2335 | '-- Add the primary business object | 2335 | '-- Add the primary business object | |
| 2336 | If Me._PrimaryBusinessObject IsNot Nothing Then | 2336 | If Me._PrimaryBusinessObject IsNot Nothing Then | |
| 2337 | loReturn.Add(Me._PrimaryBusinessObject) | 2337 | loReturn.Add(Me._PrimaryBusinessObject) | |
| 2338 | End If | 2338 | End If | |
| 2339 | 2339 | |||
| 2340 | End Select | 2340 | End Select | |
| 2341 | 2341 | |||
| 2342 | '-- Return the list | 2342 | '-- Return the list | |
| 2343 | Return loReturn.ToArray() | 2343 | Return loReturn.ToArray() | |
| 2344 | End Function | 2344 | End Function | |
| 2345 | 2345 | |||
| 2346 | ''' <summary> | 2346 | ''' <summary> | |
| 2347 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | 2347 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | |
| 2348 | ''' when Edit() is called on the form. | 2348 | ''' when Edit() is called on the form. | |
| 2349 | ''' </summary> | 2349 | ''' </summary> | |
| 2350 | ''' <returns></returns> | 2350 | ''' <returns></returns> | |
| 2351 | ''' <remarks></remarks> | 2351 | ''' <remarks></remarks> | |
| 2352 | Public Function GetListOfEditBOs() As BusinessLayer() | 2352 | Public Function GetListOfEditBOs() As BusinessLayer() | |
| 2353 | '-- Establish locals | 2353 | '-- Establish locals | |
| 2354 | Dim loReturn As New List(Of BusinessLayer) | 2354 | Dim loReturn As New List(Of BusinessLayer) | |
| 2355 | Dim loBO As BusinessLayer | 2355 | Dim loBO As BusinessLayer | |
| 2356 | 2356 | |||
| 2357 | '-- Build the list | 2357 | '-- Build the list | |
| 2358 | Select Case Me._IncludeInFormEditType | 2358 | Select Case Me._IncludeInFormEditType | |
| 2359 | Case IncludeInFormTypeOptions.AllBusinessObjects | 2359 | Case IncludeInFormTypeOptions.AllBusinessObjects | |
| 2360 | '-- Add all of the business objects to the list | 2360 | '-- Add all of the business objects to the list | |
| 2361 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | 2361 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | |
| 2362 | 2362 | |||
| 2363 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | 2363 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | |
| 2364 | '-- Add the business objects that should be added | 2364 | '-- Add the business objects that should be added | |
| 2365 | For Each loBO In Me._BusinessObjects | 2365 | For Each loBO In Me._BusinessObjects | |
| 2366 | If loBO.IncludeInFormEdit Then | 2366 | If loBO.IncludeInFormEdit Then | |
| 2367 | loReturn.Add(loBO) | 2367 | loReturn.Add(loBO) | |
| 2368 | End If | 2368 | End If | |
| 2369 | Next | 2369 | Next | |
| 2370 | 2370 | |||
| 2371 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | 2371 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 2372 | '-- Add the primary business object | 2372 | '-- Add the primary business object | |
| 2373 | If Me._PrimaryBusinessObject IsNot Nothing Then | 2373 | If Me._PrimaryBusinessObject IsNot Nothing Then | |
| 2374 | loReturn.Add(Me._PrimaryBusinessObject) | 2374 | loReturn.Add(Me._PrimaryBusinessObject) | |
| 2375 | End If | 2375 | End If | |
| 2376 | 2376 | |||
| 2377 | End Select | 2377 | End Select | |
| 2378 | 2378 | |||
| 2379 | '-- Return the list | 2379 | '-- Return the list | |
| 2380 | Return loReturn.ToArray() | 2380 | Return loReturn.ToArray() | |
| 2381 | End Function | 2381 | End Function | |
| 2382 | 2382 | |||
| 2383 | ''' <summary> | 2383 | ''' <summary> | |
| 2384 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | 2384 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | |
| 2385 | ''' when a Navigate() is called on the form. | 2385 | ''' when a Navigate() is called on the form. | |
| 2386 | ''' </summary> | 2386 | ''' </summary> | |
| 2387 | ''' <returns></returns> | 2387 | ''' <returns></returns> | |
| 2388 | ''' <remarks></remarks> | 2388 | ''' <remarks></remarks> | |
| 2389 | Public Function GetListOfNavigateBOs() As BusinessLayer() | 2389 | Public Function GetListOfNavigateBOs() As BusinessLayer() | |
| 2390 | '-- Establish locals | 2390 | '-- Establish locals | |
| 2391 | Dim loReturn As New List(Of BusinessLayer) | 2391 | Dim loReturn As New List(Of BusinessLayer) | |
| 2392 | Dim loBO As BusinessLayer | 2392 | Dim loBO As BusinessLayer | |
| 2393 | 2393 | |||
| 2394 | '-- Build the list | 2394 | '-- Build the list | |
| 2395 | Select Case Me._IncludeInFormNavigateType | 2395 | Select Case Me._IncludeInFormNavigateType | |
| 2396 | Case IncludeInFormTypeOptions.AllBusinessObjects | 2396 | Case IncludeInFormTypeOptions.AllBusinessObjects | |
| 2397 | '-- Add all of the business objects to the list | 2397 | '-- Add all of the business objects to the list | |
| 2398 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | 2398 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | |
| 2399 | 2399 | |||
| 2400 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | 2400 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | |
| 2401 | '-- Add the business objects that should be added | 2401 | '-- Add the business objects that should be added | |
| 2402 | For Each loBO In Me._BusinessObjects | 2402 | For Each loBO In Me._BusinessObjects | |
| 2403 | If loBO.IncludeInFormNavigate Then | 2403 | If loBO.IncludeInFormNavigate Then | |
| 2404 | loReturn.Add(loBO) | 2404 | loReturn.Add(loBO) | |
| 2405 | End If | 2405 | End If | |
| 2406 | Next | 2406 | Next | |
| 2407 | 2407 | |||
| 2408 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | 2408 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 2409 | '-- Add the primary business object | 2409 | '-- Add the primary business object | |
| 2410 | If Me._PrimaryBusinessObject IsNot Nothing Then | 2410 | If Me._PrimaryBusinessObject IsNot Nothing Then | |
| 2411 | loReturn.Add(Me._PrimaryBusinessObject) | 2411 | loReturn.Add(Me._PrimaryBusinessObject) | |
| 2412 | End If | 2412 | End If | |
| 2413 | 2413 | |||
| 2414 | End Select | 2414 | End Select | |
| 2415 | 2415 | |||
| 2416 | '-- Return the list | 2416 | '-- Return the list | |
| 2417 | Return loReturn.ToArray() | 2417 | Return loReturn.ToArray() | |
| 2418 | End Function | 2418 | End Function | |
| 2419 | 2419 | |||
| 2420 | ''' <summary> | 2420 | ''' <summary> | |
| 2421 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | 2421 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | |
| 2422 | ''' when Save() is called on the form. | 2422 | ''' when Save() is called on the form. | |
| 2423 | ''' </summary> | 2423 | ''' </summary> | |
| 2424 | ''' <returns></returns> | 2424 | ''' <returns></returns> | |
| 2425 | ''' <remarks></remarks> | 2425 | ''' <remarks></remarks> | |
| 2426 | Public Function GetListOfSaveBOs() As BusinessLayer() | 2426 | Public Function GetListOfSaveBOs() As BusinessLayer() | |
| 2427 | '-- Establish locals | 2427 | '-- Establish locals | |
| 2428 | Dim loReturn As New List(Of BusinessLayer) | 2428 | Dim loReturn As New List(Of BusinessLayer) | |
| 2429 | Dim loBO As BusinessLayer | 2429 | Dim loBO As BusinessLayer | |
| 2430 | 2430 | |||
| 2431 | '-- Build the list | 2431 | '-- Build the list | |
| 2432 | Select Case Me._IncludeInFormSaveType | 2432 | Select Case Me._IncludeInFormSaveType | |
| 2433 | Case IncludeInFormTypeOptions.AllBusinessObjects | 2433 | Case IncludeInFormTypeOptions.AllBusinessObjects | |
| 2434 | '-- Add all of the business objects to the list | 2434 | '-- Add all of the business objects to the list | |
| 2435 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | 2435 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | |
| 2436 | 2436 | |||
| 2437 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | 2437 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | |
| 2438 | '-- Add the business objects that should be added | 2438 | '-- Add the business objects that should be added | |
| 2439 | For Each loBO In Me._BusinessObjects | 2439 | For Each loBO In Me._BusinessObjects | |
| 2440 | If loBO.IncludeInFormSave Then | 2440 | If loBO.IncludeInFormSave Then | |
| 2441 | loReturn.Add(loBO) | 2441 | loReturn.Add(loBO) | |
| 2442 | End If | 2442 | End If | |
| 2443 | Next | 2443 | Next | |
| 2444 | 2444 | |||
| 2445 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | 2445 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 2446 | '-- Add the primary business object | 2446 | '-- Add the primary business object | |
| 2447 | If Me._PrimaryBusinessObject IsNot Nothing Then | 2447 | If Me._PrimaryBusinessObject IsNot Nothing Then | |
| 2448 | loReturn.Add(Me._PrimaryBusinessObject) | 2448 | loReturn.Add(Me._PrimaryBusinessObject) | |
| 2449 | End If | 2449 | End If | |
| 2450 | 2450 | |||
| 2451 | End Select | 2451 | End Select | |
| 2452 | 2452 | |||
| 2453 | '-- Return the list | 2453 | '-- Return the list | |
| 2454 | Return loReturn.ToArray() | 2454 | Return loReturn.ToArray() | |
| 2455 | End Function | 2455 | End Function | |
| 2456 | 2456 | |||
| 2457 | ''' <summary> | 2457 | ''' <summary> | |
| 2458 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | 2458 | ''' Returns an array of BusinessLayer objects containing all business objects that will be included | |
| 2459 | ''' when Undo() is called on the form. | 2459 | ''' when Undo() is called on the form. | |
| 2460 | ''' </summary> | 2460 | ''' </summary> | |
| 2461 | ''' <returns></returns> | 2461 | ''' <returns></returns> | |
| 2462 | ''' <remarks></remarks> | 2462 | ''' <remarks></remarks> | |
| 2463 | Public Function GetListOfUndoBOs() As BusinessLayer() | 2463 | Public Function GetListOfUndoBOs() As BusinessLayer() | |
| 2464 | '-- Establish locals | 2464 | '-- Establish locals | |
| 2465 | Dim loReturn As New List(Of BusinessLayer) | 2465 | Dim loReturn As New List(Of BusinessLayer) | |
| 2466 | Dim loBO As BusinessLayer | 2466 | Dim loBO As BusinessLayer | |
| 2467 | 2467 | |||
| 2468 | '-- Build the list | 2468 | '-- Build the list | |
| 2469 | Select Case Me._IncludeInFormUndoType | 2469 | Select Case Me._IncludeInFormUndoType | |
| 2470 | Case IncludeInFormTypeOptions.AllBusinessObjects | 2470 | Case IncludeInFormTypeOptions.AllBusinessObjects | |
| 2471 | '-- Add all of the business objects to the list | 2471 | '-- Add all of the business objects to the list | |
| 2472 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | 2472 | loReturn.AddRange(Me._BusinessObjects.ToArray()) | |
| 2473 | 2473 | |||
| 2474 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | 2474 | Case IncludeInFormTypeOptions.DeterminedByBusinessObject | |
| 2475 | '-- Add the business objects that should be added | 2475 | '-- Add the business objects that should be added | |
| 2476 | For Each loBO In Me._BusinessObjects | 2476 | For Each loBO In Me._BusinessObjects | |
| 2477 | If loBO.IncludeInFormUndo Then | 2477 | If loBO.IncludeInFormUndo Then | |
| 2478 | loReturn.Add(loBO) | 2478 | loReturn.Add(loBO) | |
| 2479 | End If | 2479 | End If | |
| 2480 | Next | 2480 | Next | |
| 2481 | 2481 | |||
| 2482 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | 2482 | Case IncludeInFormTypeOptions.PrimaryBusinessObject | |
| 2483 | '-- Add the primary business object | 2483 | '-- Add the primary business object | |
| 2484 | If Me._PrimaryBusinessObject IsNot Nothing Then | 2484 | If Me._PrimaryBusinessObject IsNot Nothing Then | |
| 2485 | loReturn.Add(Me._PrimaryBusinessObject) | 2485 | loReturn.Add(Me._PrimaryBusinessObject) | |
| 2486 | End If | 2486 | End If | |
| 2487 | 2487 | |||
| 2488 | End Select | 2488 | End Select | |
| 2489 | 2489 | |||
| 2490 | '-- Return the list | 2490 | '-- Return the list | |
| 2491 | Return loReturn.ToArray() | 2491 | Return loReturn.ToArray() | |
| 2492 | End Function | 2492 | End Function | |
| 2493 | 2493 | |||
| 2494 | ''' <summary> | 2494 | ''' <summary> | |
| 2495 | ''' Navigates each business object marked with IncludeInFormNavigate to the given index. | 2495 | ''' Navigates each business object marked with IncludeInFormNavigate to the given index. | |
| 2496 | ''' </summary> | 2496 | ''' </summary> | |
| 2497 | ''' <param name="Index">The absolute index to which the form should navigate.</param> | 2497 | ''' <param name="Index">The absolute index to which the form should navigate.</param> | |
| 2498 | ''' <remarks></remarks> | 2498 | ''' <remarks></remarks> | |
| 2499 | Public Overridable Sub NavigateAbsolute(ByVal Index As Integer) | 2499 | Public Overridable Sub NavigateAbsolute(ByVal Index As Integer) | |
| 2500 | Me.Navigate(BusinessNavigationDirection.Absolute, Index) | 2500 | Me.Navigate(BusinessNavigationDirection.Absolute, Index) | |
| 2501 | End Sub | 2501 | End Sub | |
| 2502 | 2502 | |||
| 2503 | ''' <summary> | 2503 | ''' <summary> | |
| 2504 | ''' Navigates each business object marked with IncludeInFormNavigate to the given primary key. | 2504 | ''' Navigates each business object marked with IncludeInFormNavigate to the given primary key. | |
| 2505 | ''' </summary> | 2505 | ''' </summary> | |
| 2506 | ''' <param name="Key">The Primary Key value to which the form should navigate.</param> | 2506 | ''' <param name="Key">The Primary Key value to which the form should navigate.</param> | |
| 2507 | ''' <remarks></remarks> | 2507 | ''' <remarks></remarks> | |
| 2508 | Public Overridable Sub NavigateToPrimaryKey(ByVal Key As Object) | 2508 | Public Overridable Sub NavigateToPrimaryKey(ByVal Key As Object) | |
| 2509 | Me.Navigate(BusinessNavigationDirection.ByPrimaryKey, Key) | 2509 | Me.Navigate(BusinessNavigationDirection.ByPrimaryKey, Key) | |
| 2510 | End Sub | 2510 | End Sub | |
| 2511 | 2511 | |||
| 2512 | ''' <summary> | 2512 | ''' <summary> | |
| 2513 | ''' Navigates each business object marked with IncludeInFormNavigate to the first record. | 2513 | ''' Navigates each business object marked with IncludeInFormNavigate to the first record. | |
| 2514 | ''' </summary> | 2514 | ''' </summary> | |
| 2515 | ''' <remarks></remarks> | 2515 | ''' <remarks></remarks> | |
| 2516 | Public Overridable Sub NavigateFirst() | 2516 | Public Overridable Sub NavigateFirst() | |
| 2517 | Me.Navigate(BusinessNavigationDirection.First, Nothing) | 2517 | Me.Navigate(BusinessNavigationDirection.First, Nothing) | |
| 2518 | End Sub | 2518 | End Sub | |
| 2519 | 2519 | |||
| 2520 | ''' <summary> | 2520 | ''' <summary> | |
| 2521 | ''' Navigates each business object marked with IncludeInFormNavigate to the last record. | 2521 | ''' Navigates each business object marked with IncludeInFormNavigate to the last record. | |
| 2522 | ''' </summary> | 2522 | ''' </summary> | |
| 2523 | ''' <remarks></remarks> | 2523 | ''' <remarks></remarks> | |
| 2524 | Public Overridable Sub NavigateLast() | 2524 | Public Overridable Sub NavigateLast() | |
| 2525 | Me.Navigate(BusinessNavigationDirection.Last, Nothing) | 2525 | Me.Navigate(BusinessNavigationDirection.Last, Nothing) | |
| 2526 | End Sub | 2526 | End Sub | |
| 2527 | 2527 | |||
| 2528 | ''' <summary> | 2528 | ''' <summary> | |
| 2529 | ''' Navigates each business object marked with IncludeInFormNavigate to the next record. | 2529 | ''' Navigates each business object marked with IncludeInFormNavigate to the next record. | |
| 2530 | ''' </summary> | 2530 | ''' </summary> | |
| 2531 | ''' <remarks></remarks> | 2531 | ''' <remarks></remarks> | |
| 2532 | Public Overridable Sub NavigateNext() | 2532 | Public Overridable Sub NavigateNext() | |
| 2533 | Me.Navigate(BusinessNavigationDirection.Next, Nothing) | 2533 | Me.Navigate(BusinessNavigationDirection.Next, Nothing) | |
| 2534 | End Sub | 2534 | End Sub | |
| 2535 | 2535 | |||
| 2536 | ''' <summary> | 2536 | ''' <summary> | |
| 2537 | ''' Navigates each business object marked with IncludeInFormNavigate to the prior record. | 2537 | ''' Navigates each business object marked with IncludeInFormNavigate to the prior record. | |
| 2538 | ''' </summary> | 2538 | ''' </summary> | |
| 2539 | ''' <remarks></remarks> | 2539 | ''' <remarks></remarks> | |
| 2540 | Public Overridable Sub NavigatePrior() | 2540 | Public Overridable Sub NavigatePrior() | |
| 2541 | Me.Navigate(BusinessNavigationDirection.Prior, Nothing) | 2541 | Me.Navigate(BusinessNavigationDirection.Prior, Nothing) | |
| 2542 | End Sub | 2542 | End Sub | |
| 2543 | 2543 | |||
| 2544 | ''' <summary> | 2544 | ''' <summary> | |
| 2545 | ''' Saves the changes of all business objects on the form marked with IncludeInFormSave. | 2545 | ''' Saves the changes of all business objects on the form marked with IncludeInFormSave. | |
| 2546 | ''' </summary> | 2546 | ''' </summary> | |
| 2547 | ''' <returns></returns> | 2547 | ''' <returns></returns> | |
| 2548 | ''' <remarks></remarks> | 2548 | ''' <remarks></remarks> | |
| 2549 | Public Overridable Function Save() As SaveUndoResult | 2549 | Public Overridable Function Save() As SaveUndoResult | |
| 2550 | Return Save(False, "") | 2550 | Return Save(False, "") | |
| 2551 | End Function | 2551 | End Function | |
| 2552 | 2552 | |||
| 2553 | ''' <summary> | 2553 | ''' <summary> | |
| 2554 | ''' Saves the changes of all business objects on the form marked with IncludeInFormSave. | 2554 | ''' Saves the changes of all business objects on the form marked with IncludeInFormSave. | |
| 2555 | ''' </summary> | 2555 | ''' </summary> | |
| 2556 | ''' <param name="Transactional"></param> | 2556 | ''' <param name="Transactional"></param> | |
| 2557 | ''' <returns></returns> | 2557 | ''' <returns></returns> | |
| 2558 | ''' <remarks></remarks> | 2558 | ''' <remarks></remarks> | |
| 2559 | Public Overridable Function Save(ByVal Transactional As Boolean) As SaveUndoResult | 2559 | Public Overridable Function Save(ByVal Transactional As Boolean) As SaveUndoResult | |
| 2560 | Return Save(Transactional, DEFAULT_TRANSACTIONKEY) | 2560 | Return Save(Transactional, DEFAULT_TRANSACTIONKEY) | |
| 2561 | End Function | 2561 | End Function | |
| 2562 | 2562 | |||
| 2563 | ''' <summary> | 2563 | ''' <summary> | |
| 2564 | ''' Saves the changes of all business objects on the form marked with IncludeInFormSave. | 2564 | ''' Saves the changes of all business objects on the form marked with IncludeInFormSave. | |
| 2565 | ''' </summary> | 2565 | ''' </summary> | |
| 2566 | ''' <returns></returns> | 2566 | ''' <returns></returns> | |
| 2567 | ''' <remarks></remarks> | 2567 | ''' <remarks></remarks> | |
| 2568 | Public Overridable Function Save(ByVal Transactional As Boolean, ByVal TransactionKey As String) As SaveUndoResult | 2568 | Public Overridable Function Save(ByVal Transactional As Boolean, ByVal TransactionKey As String) As SaveUndoResult | |
| 2569 | '-- Establish Locals | 2569 | '-- Establish Locals | |
| 2570 | Dim loReturn As SaveUndoResult = SaveUndoResult.Success | 2570 | Dim loReturn As SaveUndoResult = SaveUndoResult.Success | |
| 2571 | Dim loBO As BusinessLayer | 2571 | Dim loBO As BusinessLayer | |
| 2572 | Dim loBeforeSaveFormArg As New BeforeSaveUndoByFormEventArgs() | 2572 | Dim loBeforeSaveFormArg As New BeforeSaveUndoByFormEventArgs() | |
| 2573 | 'Dim loBeforeSaveBOArg As BeforeSaveUndoEventArgs | 2573 | 'Dim loBeforeSaveBOArg As BeforeSaveUndoEventArgs | |
| 2574 | Dim loAfterSaveFormArg As New AfterSaveUndoByFormEventArgs | 2574 | Dim loAfterSaveFormArg As New AfterSaveUndoByFormEventArgs | |
| 2575 | Dim loBOSaveResults As SaveByFormResults | 2575 | Dim loBOSaveResults As SaveByFormResults | |
| 2576 | Dim loErrorArgs As New ErrorSavingByFormEventArgs() | 2576 | Dim loErrorArgs As New ErrorSavingByFormEventArgs() | |
| 2577 | Dim loBusinessRulesCheckedArg As BusinessRulesCheckedEventArgs | 2577 | Dim loBusinessRulesCheckedArg As BusinessRulesCheckedEventArgs | |
| 2578 | Dim loBrokenRules As New Dictionary(Of BusinessLayer, BrokenRulesCollection) | 2578 | Dim loBrokenRules As New Dictionary(Of BusinessLayer, BrokenRulesCollection) | |
| 2579 | Dim lnBrokenRulesCountCurrentRow As Integer = 0 | 2579 | Dim lnBrokenRulesCountCurrentRow As Integer = 0 | |
| 2580 | Dim lnBrokenRulesCountTotal As Integer = 0 | 2580 | Dim lnBrokenRulesCountTotal As Integer = 0 | |
| 2581 | Dim laBOs As BusinessLayer() = Me.GetListOfSaveBOs() | 2581 | Dim laBOs As BusinessLayer() = Me.GetListOfSaveBOs() | |
| 2582 | 2582 | |||
| 2583 | '-- Enumerate through the business objects and get all of the business objects | 2583 | '-- Enumerate through the business objects and get all of the business objects | |
| 2584 | For Each loBO In laBOs | 2584 | For Each loBO In laBOs | |
| 2585 | 2585 | |||
| 2586 | '-- Check their broken rules (pass false because we don't want to raise the rules checked event until all of the business objects | 2586 | '-- Check their broken rules (pass false because we don't want to raise the rules checked event until all of the business objects | |
| 2587 | ' have attempted to save | 2587 | ' have attempted to save | |
| 2588 | If Not loBO.CheckRules(True) Then | 2588 | If Not loBO.CheckRules(True) Then | |
| 2589 | '-- Add the broken rules to the dictionary | 2589 | '-- Add the broken rules to the dictionary | |
| 2590 | loBrokenRules.Add(loBO, loBO.BrokenRules) | 2590 | loBrokenRules.Add(loBO, loBO.BrokenRules) | |
| 2591 | 2591 | |||
| 2592 | '-- And increment the count | 2592 | '-- And increment the count | |
| 2593 | lnBrokenRulesCountCurrentRow += loBO.BrokenRules.CountByRowIndex(loBO.CurrentRowIndex) | 2593 | lnBrokenRulesCountCurrentRow += loBO.BrokenRules.CountByRowIndex(loBO.CurrentRowIndex) | |
| 2594 | 2594 | |||
| 2595 | '-- Increment the total count | 2595 | '-- Increment the total count | |
| 2596 | lnBrokenRulesCountTotal += loBO.BrokenRules.Count | 2596 | lnBrokenRulesCountTotal += loBO.BrokenRules.Count | |
| 2597 | End If | 2597 | End If | |
| 2598 | Next | 2598 | Next | |
| 2599 | 2599 | |||
| 2600 | '-- Raise the event | 2600 | '-- Raise the event | |
| 2601 | loBusinessRulesCheckedArg = New BusinessRulesCheckedEventArgs(lnBrokenRulesCountCurrentRow, lnBrokenRulesCountTotal, loBrokenRules, Nothing) | 2601 | loBusinessRulesCheckedArg = New BusinessRulesCheckedEventArgs(lnBrokenRulesCountCurrentRow, lnBrokenRulesCountTotal, loBrokenRules, Nothing) | |
| 2602 | RaiseBusinessRulesCheckedEvent(loBusinessRulesCheckedArg) | 2602 | RaiseBusinessRulesCheckedEvent(loBusinessRulesCheckedArg) | |
| 2603 | 2603 | |||
| 2604 | '-- Check to see if the user wants to continue | 2604 | '-- Check to see if the user wants to continue | |
| 2605 | If (lnBrokenRulesCountTotal > 0) AndAlso (Not loBusinessRulesCheckedArg.IgnoreRulesAndForceSave) Then | 2605 | If (lnBrokenRulesCountTotal > 0) AndAlso (Not loBusinessRulesCheckedArg.IgnoreRulesAndForceSave) Then | |
| 2606 | loReturn = SaveUndoResult.AbortedWithBrokenRules | 2606 | loReturn = SaveUndoResult.AbortedWithBrokenRules | |
| 2607 | End If | 2607 | End If | |
| 2608 | 2608 | |||
| 2609 | '-- Check for soft collisions | 2609 | '-- Check for soft collisions | |
| 2610 | If loReturn = SaveUndoResult.Success Then | 2610 | If loReturn = SaveUndoResult.Success Then | |
| 2611 | '-- Raise the before save event | 2611 | '-- Raise the before save event | |
| 2612 | RaiseBeforeSaveEvent(loBeforeSaveFormArg) | 2612 | RaiseBeforeSaveEvent(loBeforeSaveFormArg) | |
| 2613 | 2613 | |||
| 2614 | '-- See if the user cancelled | 2614 | '-- See if the user cancelled | |
| 2615 | If loBeforeSaveFormArg.Cancel Then | 2615 | If loBeforeSaveFormArg.Cancel Then | |
| 2616 | loReturn = SaveUndoResult.Cancelled | 2616 | loReturn = SaveUndoResult.Cancelled | |
| 2617 | Else | 2617 | Else | |
| 2618 | '-- Cycle through all of the business objects | 2618 | '-- Cycle through all of the business objects | |
| 2619 | For Each loBO In laBOs | 2619 | For Each loBO In laBOs | |
| 2620 | 2620 | |||
| 2621 | '-- Save the business object | 2621 | '-- Save the business object | |
| 2622 | loBOSaveResults = loBO.SaveByForm(Transactional, TransactionKey) | 2622 | loBOSaveResults = loBO.SaveByForm(Transactional, TransactionKey) | |
| 2623 | 2623 | |||
| 2624 | '-- Increment the total rows saved | 2624 | '-- Increment the total rows saved | |
| 2625 | loAfterSaveFormArg.AddToTotalRowsAffected(loBOSaveResults.RowsAffected) | 2625 | loAfterSaveFormArg.AddToTotalRowsAffected(loBOSaveResults.RowsAffected) | |
| 2626 | 2626 | |||
| 2627 | '-- See if there was an error | 2627 | '-- See if there was an error | |
| 2628 | If loBOSaveResults.SaveUndoResult <> SaveUndoResult.Success Then | 2628 | If loBOSaveResults.SaveUndoResult <> SaveUndoResult.Success Then | |
| 2629 | loAfterSaveFormArg.SetSaveUndoResult(loBOSaveResults.SaveUndoResult) | 2629 | loAfterSaveFormArg.SetSaveUndoResult(loBOSaveResults.SaveUndoResult) | |
| 2630 | With loBOSaveResults | 2630 | With loBOSaveResults | |
| 2631 | loErrorArgs.AddBusinessObjectResult(loBO, New ErrorSavingEventArgs(.RowsAffected, .SaveUndoResult, .SaveUndoException)) | 2631 | loErrorArgs.AddBusinessObjectResult(loBO, New ErrorSavingEventArgs(.RowsAffected, .SaveUndoResult, .SaveUndoException)) | |
| 2632 | End With | 2632 | End With | |
| 2633 | End If | 2633 | End If | |
| 2634 | 2634 | |||
| 2635 | '-- Add the individual results to the collection | 2635 | '-- Add the individual results to the collection | |
| 2636 | loAfterSaveFormArg.AddBusinessObjectResult(loBO, loBOSaveResults) | 2636 | loAfterSaveFormArg.AddBusinessObjectResult(loBO, loBOSaveResults) | |
| 2637 | Next | 2637 | Next | |
| 2638 | 2638 | |||
| 2639 | '-- Only raise the after save event is the save was successful | 2639 | '-- Only raise the after save event is the save was successful | |
| 2640 | If loAfterSaveFormArg.SaveUndoResult = SaveUndoResult.Success Then | 2640 | If loAfterSaveFormArg.SaveUndoResult = SaveUndoResult.Success Then | |
| 2641 | '-- Raise the form after save event | 2641 | '-- Raise the form after save event | |
| 2642 | RaiseAfterSaveEvent(loAfterSaveFormArg) | 2642 | RaiseAfterSaveEvent(loAfterSaveFormArg) | |
| 2643 | ElseIf loAfterSaveFormArg.SaveUndoResult = SaveUndoResult.FailedWithExceptions Then | 2643 | ElseIf loAfterSaveFormArg.SaveUndoResult = SaveUndoResult.FailedWithExceptions Then | |
| 2644 | '-- Raise the error saving event | 2644 | '-- Raise the error saving event | |
| 2645 | RaiseErrorSavingEvent(loErrorArgs) | 2645 | RaiseErrorSavingEvent(loErrorArgs) | |
| 2646 | End If | 2646 | End If | |
| 2647 | End If | 2647 | End If | |
| 2648 | End If | 2648 | End If | |
| 2649 | 2649 | |||
| 2650 | '-- Set the return equal to the argument value | 2650 | '-- Set the return equal to the argument value | |
| 2651 | If loReturn = SaveUndoResult.Success Then | 2651 | If loReturn = SaveUndoResult.Success Then | |
| 2652 | loReturn = loAfterSaveFormArg.SaveUndoResult | 2652 | loReturn = loAfterSaveFormArg.SaveUndoResult | |
| 2653 | End If | 2653 | End If | |
| 2654 | 2654 | |||
| 2655 | '-- If the save was successful, the set the editing state of the business objects | 2655 | '-- If the save was successful, the set the editing state of the business objects | |
| 2656 | If loReturn = SaveUndoResult.Success Then | 2656 | If loReturn = SaveUndoResult.Success Then | |
| 2657 | '-- Cycle through all of the business objects | 2657 | '-- Cycle through all of the business objects | |
| 2658 | For Each loBO In laBOs | 2658 | For Each loBO In laBOs | |
| 2659 | loBO.SetEditingState(BusinessEditingState.Idle) | 2659 | loBO.SetEditingState(BusinessEditingState.Idle) | |
| 2660 | Next | 2660 | Next | |
| 2661 | End If | 2661 | End If | |
| 2662 | 2662 | |||
| 2663 | '-- Set the editing state | 2663 | '-- Set the editing state | |
| 2664 | If loBO IsNot Nothing Then | 2664 | If loBO IsNot Nothing Then | |
| 2665 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | 2665 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | |
| 2666 | End If | 2666 | End If | |
| 2667 | 2667 | |||
| 2668 | '-- Return results | 2668 | '-- Return results | |
| 2669 | Return loReturn | 2669 | Return loReturn | |
| 2670 | End Function | 2670 | End Function | |
| 2671 | 2671 | |||
| 2672 | ''' <summary> | 2672 | ''' <summary> | |
| 2673 | ''' Rejects all changes to all business objects since the business objects were last saved. | 2673 | ''' Rejects all changes to all business objects since the business objects were last saved. | |
| 2674 | ''' </summary> | 2674 | ''' </summary> | |
| 2675 | ''' <returns></returns> | 2675 | ''' <returns></returns> | |
| 2676 | ''' <remarks></remarks> | 2676 | ''' <remarks></remarks> | |
| 2677 | Public Overridable Function Undo() As SaveUndoResult | 2677 | Public Overridable Function Undo() As SaveUndoResult | |
| 2678 | '-- Establish locals | 2678 | '-- Establish locals | |
| 2679 | Dim loBO As BusinessLayer | 2679 | Dim loBO As BusinessLayer | |
| 2680 | Dim loBeforeArgs As BeforeSaveUndoByFormEventArgs | 2680 | Dim loBeforeArgs As BeforeSaveUndoByFormEventArgs | |
| 2681 | Dim loAfterArgs As New AfterSaveUndoByFormEventArgs | 2681 | Dim loAfterArgs As New AfterSaveUndoByFormEventArgs | |
| 2682 | Dim loBOAfterArgs As AfterSaveUndoEventArgs | 2682 | Dim loBOAfterArgs As AfterSaveUndoEventArgs | |
| 2683 | Dim lnTotalRowsAffected As Integer = 0 | 2683 | Dim lnTotalRowsAffected As Integer = 0 | |
| 2684 | Dim loReturn As SaveUndoResult = SaveUndoResult.Success | 2684 | Dim loReturn As SaveUndoResult = SaveUndoResult.Success | |
| 2685 | 2685 | |||
| 2686 | '-- Raise the before undo event | 2686 | '-- Raise the before undo event | |
| 2687 | loBeforeArgs = New BeforeSaveUndoByFormEventArgs() | 2687 | loBeforeArgs = New BeforeSaveUndoByFormEventArgs() | |
| 2688 | RaiseBeforeUndoEvent(loBeforeArgs) | 2688 | RaiseBeforeUndoEvent(loBeforeArgs) | |
| 2689 | 2689 | |||
| 2690 | '-- Make sure the user did not cancel the undo | 2690 | '-- Make sure the user did not cancel the undo | |
| 2691 | If loBeforeArgs.Cancel Then | 2691 | If loBeforeArgs.Cancel Then | |
| 2692 | '-- The user canceled, so set the result | 2692 | '-- The user canceled, so set the result | |
| 2693 | loReturn = SaveUndoResult.Cancelled | 2693 | loReturn = SaveUndoResult.Cancelled | |
| 2694 | Else | 2694 | Else | |
| 2695 | 2695 | |||
| 2696 | '-- Go through the registered business objects and undo them | 2696 | '-- Go through the registered business objects and undo them | |
| 2697 | For Each loBO In Me.GetListOfUndoBOs() | 2697 | For Each loBO In Me.GetListOfUndoBOs() | |
| 2698 | 2698 | |||
| 2699 | loBOAfterArgs = loBO.UndoByForm(BusinessUndoType.AllRows) | 2699 | loBOAfterArgs = loBO.UndoByForm(BusinessUndoType.AllRows) | |
| 2700 | 2700 | |||
| 2701 | '-- Increment the number of rows affected | 2701 | '-- Increment the number of rows affected | |
| 2702 | loAfterArgs.AddToTotalRowsAffected(loBOAfterArgs.RowsAffected) | 2702 | loAfterArgs.AddToTotalRowsAffected(loBOAfterArgs.RowsAffected) | |
| 2703 | 2703 | |||
| 2704 | '-- Add the individual results | 2704 | '-- Add the individual results | |
| 2705 | loAfterArgs.AddBusinessObjectResult(loBO, loBOAfterArgs) | 2705 | loAfterArgs.AddBusinessObjectResult(loBO, loBOAfterArgs) | |
| 2706 | Next | 2706 | Next | |
| 2707 | 2707 | |||
| 2708 | '-- Raise the after save event | 2708 | '-- Raise the after save event | |
| 2709 | RaiseAfterUndoEvent(loAfterArgs) | 2709 | RaiseAfterUndoEvent(loAfterArgs) | |
| 2710 | End If | 2710 | End If | |
| 2711 | 2711 | |||
| 2712 | '-- Set the editing state | 2712 | '-- Set the editing state | |
| 2713 | If loBO IsNot Nothing Then | 2713 | If loBO IsNot Nothing Then | |
| 2714 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | 2714 | RaiseEvent FormEditingStateChanged(New EditingStateChangedEventArgs(Nothing, Me.EditingState)) | |
| 2715 | End If | 2715 | End If | |
| 2716 | 2716 | |||
| 2717 | '-- Return the results | 2717 | '-- Return the results | |
| 2718 | Return loReturn | 2718 | Return loReturn | |
| 2719 | End Function | 2719 | End Function | |
| 2720 | 2720 | |||
| 2721 | ''' <summary> | 2721 | ''' <summary> | |
| 2722 | ''' Makes sure that the focus is set to a passed control. If the control | 2722 | ''' Makes sure that the focus is set to a passed control. If the control | |
| 2723 | ''' resides on a page tag, that page will be automatically selected. | 2723 | ''' resides on a page tag, that page will be automatically selected. | |
| 2724 | ''' </summary> | 2724 | ''' </summary> | |
| 2725 | ''' <param name="FocusControl"></param> | 2725 | ''' <param name="FocusControl"></param> | |
| 2726 | ''' <remarks></remarks> | 2726 | ''' <remarks></remarks> | |
| 2727 | Private Sub SetFocusToControl(ByVal FocusControl As Control) | 2727 | Private Sub SetFocusToControl(ByVal FocusControl As Control) | |
| 2728 | '-- Establish Locals | 2728 | '-- Establish Locals | |
| 2729 | Dim loParent As Control | 2729 | Dim loParent As Control | |
| 2730 | 2730 | |||
| 2731 | '-- Get the parent of the control | 2731 | '-- Get the parent of the control | |
| 2732 | loParent = FocusControl.Parent | 2732 | loParent = FocusControl.Parent | |
| 2733 | 2733 | |||
| 2734 | While loParent IsNot Nothing | 2734 | While loParent IsNot Nothing | |
| 2735 | '-- See if the parent is a page tab | 2735 | '-- See if the parent is a page tab | |
| 2736 | If loParent.GetType().IsSubclassOf(GetType(System.Windows.Forms.TabPage)) OrElse _ | 2736 | If loParent.GetType().IsSubclassOf(GetType(System.Windows.Forms.TabPage)) OrElse _ | |
| 2737 | loParent.GetType() Is GetType(System.Windows.Forms.TabPage) Then | 2737 | loParent.GetType() Is GetType(System.Windows.Forms.TabPage) Then | |
| 2738 | CType(loParent.Parent, System.Windows.Forms.TabControl).SelectedTab = CType(loParent, TabPage) | 2738 | CType(loParent.Parent, System.Windows.Forms.TabControl).SelectedTab = CType(loParent, TabPage) | |
| 2739 | End If | 2739 | End If | |
| 2740 | 2740 | |||
| 2741 | '-- Get the next parent | 2741 | '-- Get the next parent | |
| 2742 | loParent = loParent.Parent | 2742 | loParent = loParent.Parent | |
| 2743 | End While | 2743 | End While | |
| 2744 | 2744 | |||
| 2745 | '-- Set the focus on the control | 2745 | '-- Set the focus on the control | |
| 2746 | FocusControl.Focus() | 2746 | FocusControl.Focus() | |
| 2747 | End Sub | 2747 | End Sub | |
| 2748 | 2748 | |||
| 2749 | ''' <summary> | 2749 | ''' <summary> | |
| 2750 | ''' Shows the message window | 2750 | ''' Shows the message window | |
| 2751 | ''' </summary> | 2751 | ''' </summary> | |
| 2752 | ''' <param name="MessageKey">The message key (localization key) to load.</param> | 2752 | ''' <param name="MessageKey">The message key (localization key) to load.</param> | |
| 2753 | ''' <returns>Message box results (MessageFunctionType)</returns> | 2753 | ''' <returns>Message box results (MessageFunctionType)</returns> | |
| 2754 | ''' <remarks></remarks> | 2754 | ''' <remarks></remarks> | |
| 2755 | Public Function ShowMessageByKey(ByVal MessageKey As String) As MessageFunctionType | 2755 | Public Function ShowMessageByKey(ByVal MessageKey As String) As MessageFunctionType | |
| 2756 | Return MicroFour.StrataFrame.Messaging.MessageForm.ShowMessageByKey(MessageKey) | 2756 | Return MicroFour.StrataFrame.Messaging.MessageForm.ShowMessageByKey(MessageKey) | |
| 2757 | End Function | 2757 | End Function | |
| 2758 | 2758 | |||
| 2759 | ''' <summary> | 2759 | ''' <summary> | |
| 2760 | ''' Shows the message and allows formatting place markers to be replaced | 2760 | ''' Shows the message and allows formatting place markers to be replaced | |
| 2761 | ''' with the replacment values. | 2761 | ''' with the replacment values. | |
| 2762 | ''' </summary> | 2762 | ''' </summary> | |
| 2763 | ''' <param name="MessageKey"></param> | 2763 | ''' <param name="MessageKey"></param> | |
| 2764 | ''' <param name="ReplacementValues"></param> | 2764 | ''' <param name="ReplacementValues"></param> | |
| 2765 | ''' <returns></returns> | 2765 | ''' <returns></returns> | |
| 2766 | ''' <remarks></remarks> | 2766 | ''' <remarks></remarks> | |
| 2767 | Public Function ShowMessageByKey(ByVal MessageKey As String, ByVal ParamArray ReplacementValues As Object()) As MessageFunctionType | 2767 | Public Function ShowMessageByKey(ByVal MessageKey As String, ByVal ParamArray ReplacementValues As Object()) As MessageFunctionType | |
| 2768 | Return MicroFour.StrataFrame.Messaging.MessageForm.ShowMessageByKey(MessageKey, ReplacementValues) | 2768 | Return MicroFour.StrataFrame.Messaging.MessageForm.ShowMessageByKey(MessageKey, ReplacementValues) | |
| 2769 | End Function | 2769 | End Function | |
| 2770 | 2770 | |||
| 2771 | ''' <summary> | 2771 | ''' <summary> | |
| 2772 | ''' Sets the error provider on a specific control. | 2772 | ''' Sets the error provider on a specific control. | |
| 2773 | ''' </summary> | 2773 | ''' </summary> | |
| 2774 | ''' <param name="ControlInError"></param> | 2774 | ''' <param name="ControlInError"></param> | |
| 2775 | ''' <param name="ErrorMessage"></param> | 2775 | ''' <param name="ErrorMessage"></param> | |
| 2776 | ''' <remarks></remarks> | 2776 | ''' <remarks></remarks> | |
| 2777 | Public Sub SetErrorProvider(ByVal ControlInError As Control, ByVal ErrorMessage As String) | 2777 | Public Sub SetErrorProvider(ByVal ControlInError As Control, ByVal ErrorMessage As String) | |
| 2778 | '-- Set the error provider | 2778 | '-- Set the error provider | |
| 2779 | If _ErrorProvider Is Nothing Then | 2779 | If _ErrorProvider Is Nothing Then | |
| 2780 | _ErrorProvider = New ErrorProvider() | 2780 | _ErrorProvider = New ErrorProvider() | |
| 2781 | End If | 2781 | End If | |
| 2782 | 2782 | |||
| 2783 | '-- Set the settings on the error provider | 2783 | '-- Set the settings on the error provider | |
| 2784 | _ErrorProvider.BlinkRate = Me._ErrorProviderBlinkRate | 2784 | _ErrorProvider.BlinkRate = Me._ErrorProviderBlinkRate | |
| 2785 | _ErrorProvider.BlinkStyle = Me._ErrorProviderBlinkStyle | 2785 | _ErrorProvider.BlinkStyle = Me._ErrorProviderBlinkStyle | |
| 2786 | _ErrorProvider.Icon = Me._ErrorProviderIcon | 2786 | _ErrorProvider.Icon = Me._ErrorProviderIcon | |
| 2787 | 2787 | |||
| 2788 | '-- Set the error on the control | 2788 | '-- Set the error on the control | |
| 2789 | _ErrorProvider.SetError(ControlInError, ErrorMessage) | 2789 | _ErrorProvider.SetError(ControlInError, ErrorMessage) | |
| 2790 | _ErrorProvider.SetIconAlignment(ControlInError, Me._ErrorProviderIconAlignment) | 2790 | _ErrorProvider.SetIconAlignment(ControlInError, Me._ErrorProviderIconAlignment) | |
| 2791 | _ErrorProvider.SetIconPadding(ControlInError, Me._ErrorProviderIconPadding) | 2791 | _ErrorProvider.SetIconPadding(ControlInError, Me._ErrorProviderIconPadding) | |
| 2792 | End Sub | 2792 | End Sub | |
| 2793 | 2793 | |||
| 2794 | ''' <summary> | 2794 | ''' <summary> | |
| 2795 | ''' Clears the error provider indicators added by calls to SetErrorProvider (does not clear | 2795 | ''' Clears the error provider indicators added by calls to SetErrorProvider (does not clear | |
| 2796 | ''' the error provider on controls automatically bound to business objects). | 2796 | ''' the error provider on controls automatically bound to business objects). | |
| 2797 | ''' </summary> | 2797 | ''' </summary> | |
| 2798 | ''' <remarks></remarks> | 2798 | ''' <remarks></remarks> | |
| 2799 | Public Sub ClearErrorProvider() | 2799 | Public Sub ClearErrorProvider() | |
| 2800 | If Me._ErrorProvider IsNot Nothing Then | 2800 | If Me._ErrorProvider IsNot Nothing Then | |
| 2801 | Me._ErrorProvider.Clear() | 2801 | Me._ErrorProvider.Clear() | |
| 2802 | End If | 2802 | End If | |
| 2803 | End Sub | 2803 | End Sub | |
| 2804 | 2804 | |||
| 2805 | #End Region | 2805 | #End Region | |
| 2806 | 2806 | |||
| 2807 | #Region " Event Handlers " | 2807 | #Region " Event Handlers " | |
| 2808 | 2808 | |||
| 2809 | ''' <summary> | 2809 | ''' <summary> | |
| 2810 | ''' Adds necessary handlers for events on the given business object | 2810 | ''' Adds necessary handlers for events on the given business object | |
| 2811 | ''' </summary> | 2811 | ''' </summary> | |
| 2812 | ''' <param name="BusinessObject"></param> | 2812 | ''' <param name="BusinessObject"></param> | |
| 2813 | ''' <remarks></remarks> | 2813 | ''' <remarks></remarks> | |
| 2814 | Private Sub AddBusinessObjectHandlers(ByVal BusinessObject As BusinessLayer) | 2814 | Private Sub AddBusinessObjectHandlers(ByVal BusinessObject As BusinessLayer) | |
| 2815 | '-- Add the handlers for the business object | 2815 | '-- Add the handlers for the business object | |
| 2816 | AddHandler BusinessObject.AfterDelete, AddressOf HandleBOAfterDelete | 2816 | AddHandler BusinessObject.AfterDelete, AddressOf HandleBOAfterDelete | |
| 2817 | AddHandler BusinessObject.BeforeDelete, AddressOf HandleBOBeforeDelete | 2817 | AddHandler BusinessObject.BeforeDelete, AddressOf HandleBOBeforeDelete | |
| 2818 | AddHandler BusinessObject.ConcurrencyException, AddressOf HandleBOConcurrencyException | 2818 | AddHandler BusinessObject.ConcurrencyException, AddressOf HandleBOConcurrencyException | |
| 2819 | AddHandler BusinessObject.EditingStateChanged, AddressOf HandleBOEditingStateChanged | 2819 | AddHandler BusinessObject.EditingStateChanged, AddressOf HandleBOEditingStateChanged | |
| 2820 | AddHandler BusinessObject.Navigated, AddressOf HandleBONavigated | 2820 | AddHandler BusinessObject.Navigated, AddressOf HandleBONavigated | |
| 2821 | AddHandler BusinessObject.SecurityDenied, AddressOf HandleSecurityDenied | 2821 | AddHandler BusinessObject.SecurityDenied, AddressOf HandleSecurityDenied | |
| 2822 | 2822 | |||
| 2823 | If Me.IsChildForm Then | 2823 | If Me.IsChildForm Then | |
| 2824 | AddHandler BusinessObject.BusinessRulesChecked, AddressOf Me.BaseForm_BusinessRulesChecked | 2824 | AddHandler BusinessObject.BusinessRulesChecked, AddressOf Me.BaseForm_BusinessRulesChecked | |
| 2825 | End If | 2825 | End If | |
| 2826 | End Sub | 2826 | End Sub | |
| 2827 | 2827 | |||
| 2828 | ''' <summary> | 2828 | ''' <summary> | |
| 2829 | ''' Removes the event handlers that were created by AddBusinessObjectHandlers | 2829 | ''' Removes the event handlers that were created by AddBusinessObjectHandlers | |
| 2830 | ''' </summary> | 2830 | ''' </summary> | |
| 2831 | ''' <param name="BusinessObject"></param> | 2831 | ''' <param name="BusinessObject"></param> | |
| 2832 | ''' <remarks></remarks> | 2832 | ''' <remarks></remarks> | |
| 2833 | Public Sub RemoveBusinessObjectHandlers(ByVal BusinessObject As BusinessLayer) | 2833 | Public Sub RemoveBusinessObjectHandlers(ByVal BusinessObject As BusinessLayer) | |
| 2834 | '-- Add the handlers for the business object | 2834 | '-- Add the handlers for the business object | |
| 2835 | RemoveHandler BusinessObject.AfterDelete, AddressOf HandleBOAfterDelete | 2835 | RemoveHandler BusinessObject.AfterDelete, AddressOf HandleBOAfterDelete | |
| 2836 | RemoveHandler BusinessObject.BeforeDelete, AddressOf HandleBOBeforeDelete | 2836 | RemoveHandler BusinessObject.BeforeDelete, AddressOf HandleBOBeforeDelete | |
| 2837 | RemoveHandler BusinessObject.ConcurrencyException, AddressOf HandleBOConcurrencyException | 2837 | RemoveHandler BusinessObject.ConcurrencyException, AddressOf HandleBOConcurrencyException | |
| 2838 | RemoveHandler BusinessObject.EditingStateChanged, AddressOf HandleBOEditingStateChanged | 2838 | RemoveHandler BusinessObject.EditingStateChanged, AddressOf HandleBOEditingStateChanged | |
| 2839 | RemoveHandler BusinessObject.Navigated, AddressOf HandleBONavigated | 2839 | RemoveHandler BusinessObject.Navigated, AddressOf HandleBONavigated | |
| 2840 | RemoveHandler BusinessObject.SecurityDenied, AddressOf HandleSecurityDenied | 2840 | RemoveHandler BusinessObject.SecurityDenied, AddressOf HandleSecurityDenied | |
| 2841 | 2841 | |||
| 2842 | If Me.IsChildForm Then | 2842 | If Me.IsChildForm Then | |
| 2843 | RemoveHandler BusinessObject.BusinessRulesChecked, AddressOf Me.BaseForm_BusinessRulesChecked | 2843 | RemoveHandler BusinessObject.BusinessRulesChecked, AddressOf Me.BaseForm_BusinessRulesChecked | |
| 2844 | End If | 2844 | End If | |
| 2845 | End Sub | 2845 | End Sub | |
| 2846 | 2846 | |||
| 2847 | ''' <summary> | 2847 | ''' <summary> | |
| 2848 | ''' Handles the BusinessRulesChecked event and shows an alert box | 2848 | ''' Handles the BusinessRulesChecked event and shows an alert box | |
| 2849 | ''' </summary> | 2849 | ''' </summary> | |
| 2850 | ''' <param name="e"></param> | 2850 | ''' <param name="e"></param> | |
| 2851 | ''' <remarks></remarks> | 2851 | ''' <remarks></remarks> | |
| 2852 | Private Sub BaseForm_BusinessRulesChecked(ByVal e As StrataFrame.Business.BusinessRulesCheckedEventArgs) Handles Me.BusinessRulesChecked | 2852 | Private Sub BaseForm_BusinessRulesChecked(ByVal e As StrataFrame.Business.BusinessRulesCheckedEventArgs) Handles Me.BusinessRulesChecked | |
| 2853 | '-- Check to see if the user wants to show the alert box | 2853 | '-- Check to see if the user wants to show the alert box | |
| 2854 | If ((e.BusinessObject Is Nothing) OrElse (e.BusinessObject Is _PrimaryBusinessObject)) AndAlso _ | 2854 | If ((e.BusinessObject Is Nothing) OrElse (e.BusinessObject Is _PrimaryBusinessObject)) AndAlso _ | |
| 2855 | (_AutoShowBrokenRulesAlert) AndAlso (e.CountOfBrokenRulesTotal > 0) Then | 2855 | (_AutoShowBrokenRulesAlert) AndAlso (e.CountOfBrokenRulesTotal > 0) Then | |
| 2856 | If e.CountOfBrokenRulesAdditionalRows > 0 Then | 2856 | If e.CountOfBrokenRulesAdditionalRows > 0 Then | |
| 2857 | '-- We need to use the additional rows message | 2857 | '-- We need to use the additional rows message | |
| 2858 | InfoBox.ErrorBox(Localization.RetrieveTextValue(_BrokenRulesAlertTitleKey, _BrokenRulesAlertTitle), String.Format(Localization.RetrieveTextValue(_BrokenRulesAlertTextMoreThanOneRowKey, _BrokenRulesAlertTextMoreThanOneRow), e.CountOfBrokenRulesCurrentRow, e.CountOfBrokenRulesAdditionalRows, e.CountOfBrokenRulesTotal), Me) | 2858 | InfoBox.ErrorBox(Localization.RetrieveTextValue(_BrokenRulesAlertTitleKey, _BrokenRulesAlertTitle), String.Format(Localization.RetrieveTextValue(_BrokenRulesAlertTextMoreThanOneRowKey, _BrokenRulesAlertTextMoreThanOneRow), e.CountOfBrokenRulesCurrentRow, e.CountOfBrokenRulesAdditionalRows, e.CountOfBrokenRulesTotal), Me) | |
| 2859 | Else | 2859 | Else | |
| 2860 | InfoBox.ErrorBox(Localization.RetrieveTextValue(_BrokenRulesAlertTitleKey, _BrokenRulesAlertTitle), String.Format(Localization.RetrieveTextValue(_BrokenRulesAlertTextKey, _BrokenRulesAlertText), e.CountOfBrokenRulesCurrentRow, e.CountOfBrokenRulesAdditionalRows, e.CountOfBrokenRulesTotal), Me) | 2860 | InfoBox.ErrorBox(Localization.RetrieveTextValue(_BrokenRulesAlertTitleKey, _BrokenRulesAlertTitle), String.Format(Localization.RetrieveTextValue(_BrokenRulesAlertTextKey, _BrokenRulesAlertText), e.CountOfBrokenRulesCurrentRow, e.CountOfBrokenRulesAdditionalRows, e.CountOfBrokenRulesTotal), Me) | |
| 2861 | End If | 2861 | End If | |
| 2862 | End If | 2862 | End If | |
| 2863 | End Sub | 2863 | End Sub | |
| 2864 | 2864 | |||
| 2865 | ''' <summary> | 2865 | ''' <summary> | |
| 2866 | ''' Raises the before delete event to the child form | 2866 | ''' Raises the before delete event to the child form | |
| 2867 | ''' </summary> | 2867 | ''' </summary> | |
| 2868 | ''' <param name="e"></param> | 2868 | ''' <param name="e"></param> | |
| 2869 | ''' <remarks></remarks> | 2869 | ''' <remarks></remarks> | |
| 2870 | Private Sub HandleBOBeforeDelete(ByVal e As BeforeDeleteEventArgs) | 2870 | Private Sub HandleBOBeforeDelete(ByVal e As BeforeDeleteEventArgs) | |
| 2871 | '-- See if there is the auto deletion confirmation should be shown. | 2871 | '-- See if there is the auto deletion confirmation should be shown. | |
| 2872 | If Me._AutoShowDeleteConfirmation Then | 2872 | If Me._AutoShowDeleteConfirmation Then | |
| 2873 | If MicroFour.StrataFrame.Messaging.MessageForm.ShowMessage(_AutoDeleteTitle, _AutoDeleteMessage, "", Messaging.MessageFunction.YesNo, Messaging.MessagingIcon.Question, Messaging.MessagingSounds.Question) = Messaging.MessageFunctionType.No Then | 2873 | If MicroFour.StrataFrame.Messaging.MessageForm.ShowMessage(_AutoDeleteTitle, _AutoDeleteMessage, "", Messaging.MessageFunction.YesNo, Messaging.MessagingIcon.Question, Messaging.MessagingSounds.Question) = Messaging.MessageFunctionType.No Then | |
| 2874 | e.Cancel = True | 2874 | e.Cancel = True | |
| 2875 | End If | 2875 | End If | |
| 2876 | End If | 2876 | End If | |
| 2877 | 2877 | |||
| 2878 | If e.BusinessObject Is _PrimaryBusinessObject Then | 2878 | If e.BusinessObject Is _PrimaryBusinessObject Then | |
| 2879 | '-- Raise the event | 2879 | '-- Raise the event | |
| 2880 | RaiseBeforeDeleteEvent(e) | 2880 | RaiseBeforeDeleteEvent(e) | |
| 2881 | End If | 2881 | End If | |
| 2882 | End Sub | 2882 | End Sub | |
| 2883 | 2883 | |||
| 2884 | ''' <summary> | 2884 | ''' <summary> | |
| 2885 | ''' Captures the primary business object's after delete event and | 2885 | ''' Captures the primary business object's after delete event and | |
| 2886 | ''' raises to the form. | 2886 | ''' raises to the form. | |
| 2887 | ''' </summary> | 2887 | ''' </summary> | |
| 2888 | ''' <param name="e"></param> | 2888 | ''' <param name="e"></param> | |
| 2889 | ''' <remarks></remarks> | 2889 | ''' <remarks></remarks> | |
| 2890 | Private Sub HandleBOAfterDelete(ByVal e As AfterDeleteEventArgs) | 2890 | Private Sub HandleBOAfterDelete(ByVal e As AfterDeleteEventArgs) | |
| 2891 | If e.BusinessObject Is _PrimaryBusinessObject Then | 2891 | If e.BusinessObject Is _PrimaryBusinessObject Then | |
| 2892 | '-- Raise the event | 2892 | '-- Raise the event | |
| 2893 | RaiseAfterDeleteEvent(e) | 2893 | RaiseAfterDeleteEvent(e) | |
| 2894 | End If | 2894 | End If | |
| 2895 | End Sub | 2895 | End Sub | |
| 2896 | 2896 | |||
| 2897 | Private Sub HandleBONavigated(ByVal e As NavigatedEventArgs) | 2897 | Private Sub HandleBONavigated(ByVal e As NavigatedEventArgs) | |
| 2898 | '-- Raise the form navigated event | 2898 | '-- Raise the form navigated event | |
| 2899 | RaiseEvent FormNavigated(e) | 2899 | RaiseEvent FormNavigated(e) | |
| 2900 | End Sub | 2900 | End Sub | |
| 2901 | 2901 | |||
| 2902 | ''' <summary> | 2902 | ''' <summary> | |
| 2903 | ''' Handles the SecurityDenied event of business objects belonging to this form. | 2903 | ''' Handles the SecurityDenied event of business objects belonging to this form. | |
| 2904 | ''' </summary> | 2904 | ''' </summary> | |
| 2905 | ''' <param name="sender"></param> | 2905 | ''' <param name="sender"></param> | |
| 2906 | ''' <param name="e"></param> | 2906 | ''' <param name="e"></param> | |
| 2907 | ''' <remarks></remarks> | 2907 | ''' <remarks></remarks> | |
| 2908 | Private Sub HandleSecurityDenied(ByVal sender As Object, ByVal e As SecurityDeniedEventArgs) | 2908 | Private Sub HandleSecurityDenied(ByVal sender As Object, ByVal e As SecurityDeniedEventArgs) | |
| 2909 | Me.OnSecurityDenied(e, False) | 2909 | Me.OnSecurityDenied(e, False) | |
| 2910 | End Sub | 2910 | End Sub | |
| 2911 | 2911 | |||
| 2912 | Private Sub HandleBOConcurrencyException(ByVal e As ConcurrencyExceptionEventArgs) | 2912 | Private Sub HandleBOConcurrencyException(ByVal e As ConcurrencyExceptionEventArgs) | |
| 2913 | '-- Raise the form's concurrency exception event | 2913 | '-- Raise the form's concurrency exception event | |
| 2914 | RaiseEvent ConcurrencyException(e) | 2914 | RaiseEvent ConcurrencyException(e) | |
| 2915 | End Sub | 2915 | End Sub | |
| 2916 | 2916 | |||
| 2917 | ''' <summary> | 2917 | ''' <summary> | |
| 2918 | ''' Handles the event that is raised when an exception occurrs while trying to save the business objects | 2918 | ''' Handles the event that is raised when an exception occurrs while trying to save the business objects | |
| 2919 | ''' on the form | 2919 | ''' on the form | |
| 2920 | ''' </summary> | 2920 | ''' </summary> | |
| 2921 | ''' <param name="e"></param> | 2921 | ''' <param name="e"></param> | |
| 2922 | ''' <remarks></remarks> | 2922 | ''' <remarks></remarks> | |
| 2923 | Private Sub BaseForm_ErrorSaving(ByVal e As Business.ErrorSavingByFormEventArgs) Handles Me.ErrorSaving | 2923 | Private Sub BaseForm_ErrorSaving(ByVal e As Business.ErrorSavingByFormEventArgs) Handles Me.ErrorSaving | |
| 2924 | '-- Establish locals | 2924 | '-- Establish locals | |
| 2925 | Dim loMessageItem As Messaging.MessageItem | 2925 | Dim loMessageItem As Messaging.MessageItem | |
| 2926 | Dim loBO As BusinessLayer | 2926 | Dim loBO As BusinessLayer | |
| 2927 | Dim loMessage As New System.Text.StringBuilder(1024) | 2927 | Dim loMessage As New System.Text.StringBuilder(1024) | |
| 2928 | Dim loException As Exception | 2928 | Dim loException As Exception | |
| 2929 | Dim loErrorArgs As ErrorSavingEventArgs | 2929 | Dim loErrorArgs As ErrorSavingEventArgs | |
| 2930 | 2930 | |||
| 2931 | '-- Determine if we need to show the message | 2931 | '-- Determine if we need to show the message | |
| 2932 | If _AutoShowSavingErrors Then | 2932 | If _AutoShowSavingErrors Then | |
| 2933 | '-- Create the message | 2933 | '-- Create the message | |
| 2934 | loMessage.AppendLine("An error occurred while trying to save the data back to the server. See the message below for more details.") | 2934 | loMessage.AppendLine("An error occurred while trying to save the data back to the server. See the message below for more details.") | |
| 2935 | loMessage.AppendLine() | 2935 | loMessage.AppendLine() | |
| 2936 | loMessage.AppendLine() | 2936 | loMessage.AppendLine() | |
| 2937 | 2937 | |||
| 2938 | '-- Cycle through the business objects and create the message | 2938 | '-- Cycle through the business objects and create the message | |
| 2939 | For Each loBO In e.ResultsByBusinessObject.Keys | 2939 | For Each loBO In e.ResultsByBusinessObject.Keys | |
| 2940 | '-- Get the reference to the individual event args | 2940 | '-- Get the reference to the individual event args | |
| 2941 | loErrorArgs = e.ResultsByBusinessObject(loBO) | 2941 | loErrorArgs = e.ResultsByBusinessObject(loBO) | |
| 2942 | 2942 | |||
| 2943 | '-- Append the message to the result | 2943 | '-- Append the message to the result | |
| 2944 | If loErrorArgs.SaveUndoResult = SaveUndoResult.FailedWithExceptions Then | 2944 | If loErrorArgs.SaveUndoResult = SaveUndoResult.FailedWithExceptions Then | |
| 2945 | '-- We need to add this one to the list | 2945 | '-- We need to add this one to the list | |
| 2946 | loMessage.Append(loBO.GetType().Name) | 2946 | loMessage.Append(loBO.GetType().Name) | |
| 2947 | loMessage.AppendLine(":") | 2947 | loMessage.AppendLine(":") | |
| 2948 | 2948 | |||
| 2949 | '-- Get the Exception | 2949 | '-- Get the Exception | |
| 2950 | loException = loErrorArgs.SaveUndoException | 2950 | loException = loErrorArgs.SaveUndoException | |
| 2951 | 2951 | |||
| 2952 | While loException IsNot Nothing | 2952 | While loException IsNot Nothing | |
| 2953 | loMessage.Append(ControlChars.Tab) | 2953 | loMessage.Append(ControlChars.Tab) | |
| 2954 | loMessage.AppendLine(loException.Message) | 2954 | loMessage.AppendLine(loException.Message) | |
| 2955 | 2955 | |||
| 2956 | '-- Get the next exception | 2956 | '-- Get the next exception | |
| 2957 | loException = loException.InnerException | 2957 | loException = loException.InnerException | |
| 2958 | End While | 2958 | End While | |
| 2959 | End If | 2959 | End If | |
| 2960 | Next | 2960 | Next | |
| 2961 | 2961 | |||
| 2962 | '-- Show the message to the user | 2962 | '-- Show the message to the user | |
| 2963 | loMessageItem = New Messaging.MessageItem() | 2963 | loMessageItem = New Messaging.MessageItem() | |
| 2964 | loMessageItem.Title = "Error Saving" | 2964 | loMessageItem.Title = "Error Saving" | |
| 2965 | loMessageItem.MessageIcon = Messaging.MessagingIcon.Fatal | 2965 | loMessageItem.MessageIcon = Messaging.MessagingIcon.Fatal | |
| 2966 | loMessageItem.MessageFunctionality = Messaging.MessageFunction.OK | 2966 | loMessageItem.MessageFunctionality = Messaging.MessageFunction.OK | |
| 2967 | loMessageItem.Text = loMessage.ToString() | 2967 | loMessageItem.Text = loMessage.ToString() | |
| 2968 | loMessageItem.MessageWidth = MessageWidthSize.Medium | 2968 | loMessageItem.MessageWidth = MessageWidthSize.Medium | |
| 2969 | loMessageItem.MessageHeight = MessageHeightSize.Medium | 2969 | loMessageItem.MessageHeight = MessageHeightSize.Medium | |
| 2970 | loMessageItem.MessageSound = MessagingSounds.Fatal | 2970 | loMessageItem.MessageSound = MessagingSounds.Fatal | |
| 2971 | 2971 | |||
| 2972 | Messaging.MessageForm.ShowMessage(loMessageItem) | 2972 | Messaging.MessageForm.ShowMessage(loMessageItem) | |
| 2973 | End If | 2973 | End If | |
| 2974 | End Sub | 2974 | End Sub | |
| 2975 | 2975 | |||
| 2976 | ''' <summary> | 2976 | ''' <summary> | |
| 2977 | ''' Handles this form's unsaved changes exist | 2977 | ''' Handles this form's unsaved changes exist | |
| 2978 | ''' </summary> | 2978 | ''' </summary> | |
| 2979 | ''' <param name="e"></param> | 2979 | ''' <param name="e"></param> | |
| 2980 | ''' <remarks></remarks> | 2980 | ''' <remarks></remarks> | |
| 2981 | Private Sub BaseForm_UnsavedChangesExist(ByVal e As Business.UnsavedChangesExistEventArgs) Handles Me.UnsavedChangesExist | 2981 | Private Sub BaseForm_UnsavedChangesExist(ByVal e As Business.UnsavedChangesExistEventArgs) Handles Me.UnsavedChangesExist | |
| 2982 | '-- Determine if we need to show the auto save message | 2982 | '-- Determine if we need to show the auto save message | |
| 2983 | If Me._AutoShowSaveChangesMessage Then | 2983 | If Me._AutoShowSaveChangesMessage Then | |
| 2984 | Select Case MessageForm.ShowMessage(_AutoSaveChangesTitle, _AutoSaveChangesMessage, "", MessageFunction.YesNoCancel, MessagingIcon.Question, MessagingSounds.Question, 0) | 2984 | Select Case MessageForm.ShowMessage(_AutoSaveChangesTitle, _AutoSaveChangesMessage, "", MessageFunction.YesNoCancel, MessagingIcon.Question, MessagingSounds.Question, 0) | |
| 2985 | Case MessageFunctionType.Yes | 2985 | Case MessageFunctionType.Yes | |
| 2986 | '-- The form needs to be saved | 2986 | '-- The form needs to be saved | |
| 2987 | e.ExitStatus = ExitStatus.ExitWithSave | 2987 | e.ExitStatus = ExitStatus.ExitWithSave | |
| 2988 | 2988 | |||
| 2989 | Case MessageFunctionType.No | 2989 | Case MessageFunctionType.No | |
| 2990 | '-- Don't save the data and exit | 2990 | '-- Don't save the data and exit | |
| 2991 | e.ExitStatus = ExitStatus.ExitWithoutSave | 2991 | e.ExitStatus = ExitStatus.ExitWithoutSave | |
| 2992 | 2992 | |||
| 2993 | Case MessageFunctionType.Cancel | 2993 | Case MessageFunctionType.Cancel | |
| 2994 | '-- Don't save and cancel the form closing | 2994 | '-- Don't save and cancel the form closing | |
| 2995 | e.ExitStatus = ExitStatus.CancelExit | 2995 | e.ExitStatus = ExitStatus.CancelExit | |
| 2996 | 2996 | |||
| 2997 | End Select | 2997 | End Select | |
| 2998 | End If | 2998 | End If | |
| 2999 | End Sub | 2999 | End Sub | |
| 3000 | 3000 | |||
| 3001 | #End Region | 3001 | #End Region | |
| 3002 | 3002 | |||
| 3003 | End Class | 3003 | End Class | |
| 3004 | 3004 | |||
| 3005 | End Namespace | 3005 | End Namespace |